Commit c3072914 by talequale

header template

parent 80ad3716
...@@ -198,7 +198,7 @@ NS.apply = function(a,b) { ...@@ -198,7 +198,7 @@ NS.apply = function(a,b) {
tr: null, tr: null,
Text: function( val ){ return document.createTextNode( val );} Text: function( val ){ return document.createTextNode( val );}
}; };
'div,span,input,label,canvas,span,textarea,table,tr,td,th,tBody,tHead'.split( ',' ).forEach( function( name ){ 'div,template,span,input,label,canvas,span,textarea,table,tr,td,th,tBody,tHead'.split( ',' ).forEach( function( name ){
D[ name ] = function(){ D[ name ] = function(){
return domEl.apply( null, [ name ].concat([].slice.call(arguments))) return domEl.apply( null, [ name ].concat([].slice.call(arguments)))
}; };
...@@ -240,7 +240,7 @@ NS.apply = function(a,b) { ...@@ -240,7 +240,7 @@ NS.apply = function(a,b) {
} }
if( type !== 'object' ){ if( type !== 'object' ){
if( type === 'function' ){ if( type === 'function' ){
var tmp = D.span( {} ); var tmp = D.div( {cls: 'zero-wrapper'} );
el.appendChild( tmp ); el.appendChild( tmp );
subEl( function(){ subEl( function(){
D.removeChildren( tmp ); D.removeChildren( tmp );
...@@ -397,4 +397,4 @@ var D = NS.D, ...@@ -397,4 +397,4 @@ var D = NS.D,
view = { view = {
page: {}, page: {},
cmp: {} cmp: {}
}; };
\ No newline at end of file
...@@ -225,4 +225,7 @@ Store.IF = function(cfg, children){ ...@@ -225,4 +225,7 @@ Store.IF = function(cfg, children){
} ); } );
} }
}; };
typeof module === 'object' && (module.exports = Store); Store.NOT = Store.AGGREGATE(function(values, length) {
\ No newline at end of file return !values[0];
});
typeof module === 'object' && (module.exports = Store);
import './Header.scss'; import './Header.scss';
const {IF, NOT} = Store;
export default D.declare('view.block.Header', () => { export default D.declare('view.block.Header', () => {
return <header class="page-header"> return <header class="page-header">
{ {
...@@ -10,7 +10,9 @@ export default D.declare('view.block.Header', () => { ...@@ -10,7 +10,9 @@ export default D.declare('view.block.Header', () => {
<button type={'button'} onClick={() => store.set('navigation.current', name)}>{name}</button> <button type={'button'} onClick={() => store.set('navigation.current', name)}>{name}</button>
) )
} }
<IF condition={NOT(store.valEqual( 'navigation.current', 'login'))}>
<b>kkk</b>
</IF>
</header> </header>
}); });
export default D.declare('view.block.Info', function(cfg, children) { export default D.declare('view.block.Info', function(cfg, children) {
return <div> return <div class="welcome-page__inner">
<div class={'img-baba'}>{cfg.img}</div> <div class={'welcome-page__image'}>{cfg.img}</div>
<div class={'img-butn'}>{children}{cfg.buttons}</div> <div class={'welcome-page__info'}>{children}{cfg.buttons}</div>
</div> </div>
}); });
...@@ -4,12 +4,10 @@ import './welcomePage.scss'; ...@@ -4,12 +4,10 @@ import './welcomePage.scss';
export default D.declare('view.page.Account', () => export default D.declare('view.page.Account', () =>
<div class="welcome-page"> <div class="welcome-page">
<div class="welcome-page__wrapper"> <div class="welcome-page__wrapper">
Hello, {store.val('account.name')}
<Info <Info
img={ img={
<picture> <picture>
<source /> <source srcset="/uploads/images/assistant-welcome-mob.svg" media={"(max-width: 767px)"}/>
<img src="/uploads/images/assistant-welcome.svg" alt={"Изображение помощника"}/> <img src="/uploads/images/assistant-welcome.svg" alt={"Изображение помощника"}/>
</picture> </picture>
} }
......
...@@ -5,5 +5,12 @@ ...@@ -5,5 +5,12 @@
.welcome-page__wrapper { .welcome-page__wrapper {
@include container; @include container;
}
.welcome-page__inner {
display: flex; display: flex;
} }
.welcome-page__info {
order: -1;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment