feat(theme): add base header in one column layout

This commit is contained in:
tibing 2017-04-17 08:28:11 +03:00
parent ed658566b3
commit 43f174a051
4 changed files with 20 additions and 12 deletions

View file

@ -1,14 +1,14 @@
:host { :host /deep/ {
& > nga-layout-header { nga-layout-header > nav {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
& > nga-sidebar { nga-sidebar {
} }
& > nga-layout-footer { nga-layout-footer {
} }
} }

View file

@ -9,12 +9,20 @@
* */ * */
import { Component } from '@angular/core'; import { Component } from '@angular/core';
@Component({ @Component({
selector: 'one-coll-layout', selector: 'one-coll-layout',
styleUrls: ['./one-coll.layout.scss'], styleUrls: ['./one-coll.layout.scss'],
template: ` template: `
<nga-layout> <nga-layout>
<nga-layout-header fixed></nga-layout-header> <nga-layout-header fixed>
<section>
<h1>Logo</h1>
</section>
<section>
<nga-user></nga-user>
</section>
</nga-layout-header>
<nga-sidebar fixed> <nga-sidebar fixed>
<ng-content select="nga-menu"></ng-content> <ng-content select="nga-menu"></ng-content>
</nga-sidebar> </nga-sidebar>
@ -25,6 +33,5 @@ import { Component } from '@angular/core';
</nga-layout> </nga-layout>
`, `,
}) })
export class RootLayoutComponent { export class OneCollLayoutComponent {
constructor() { }
} }

View file

@ -12,7 +12,7 @@ import {
NgaUserModule NgaUserModule
} from '@nga/theme'; } from '@nga/theme';
import { RootLayoutComponent } from './layouts'; import { OneCollLayoutComponent } from './layouts';
const BASE_MODULES = [ const BASE_MODULES = [
CommonModule, CommonModule,
@ -25,24 +25,25 @@ const NGA_MODULES = [
NgaLayoutModule, NgaLayoutModule,
NgaTabsetModule, NgaTabsetModule,
NgaRouteTabsetModule, NgaRouteTabsetModule,
NgaSidebarModule,
NgaMenuModule, NgaMenuModule,
NgaUserModule NgaUserModule
]; ];
const LAYOUT_COMPONENTS = [ const LAYOUT_COMPONENTS = [
RootLayoutComponent OneCollLayoutComponent
]; ];
@NgModule({ @NgModule({
imports: [ imports: [
...BASE_MODULES, ...BASE_MODULES,
...NGA_MODULES, ...NGA_MODULES,
NgaSidebarModule.forRoot(),
], ],
exports: [ exports: [
...BASE_MODULES, ...BASE_MODULES,
...NGA_MODULES, ...NGA_MODULES,
...LAYOUT_COMPONENTS ...LAYOUT_COMPONENTS,
NgaSidebarModule
], ],
declarations: [ declarations: [
...LAYOUT_COMPONENTS ...LAYOUT_COMPONENTS

View file

@ -1,4 +1,4 @@
import { NgaMenuItem } from '@nga/theme/components/menu/menu.options'; import { NgaMenuItem } from '@nga/theme';
import { List } from 'immutable'; import { List } from 'immutable';