2018-06-21 15:16:53 +03:00
|
|
|
import { Component, OnDestroy } from '@angular/core';
|
|
|
|
|
import { NbThemeService } from '@nebular/theme';
|
2018-11-19 15:40:01 +02:00
|
|
|
import { takeWhile } from 'rxjs/operators';
|
2017-07-28 14:54:29 +03:00
|
|
|
|
|
|
|
|
// TODO: move layouts into the framework
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'ngx-two-columns-layout',
|
|
|
|
|
styleUrls: ['./two-columns.layout.scss'],
|
|
|
|
|
template: `
|
2017-08-01 17:42:21 +03:00
|
|
|
<nb-layout>
|
|
|
|
|
<nb-layout-header fixed>
|
2017-07-28 14:54:29 +03:00
|
|
|
<ngx-header></ngx-header>
|
2017-08-01 17:42:21 +03:00
|
|
|
</nb-layout-header>
|
2017-07-28 14:54:29 +03:00
|
|
|
|
2017-08-01 17:42:21 +03:00
|
|
|
<nb-sidebar class="menu-sidebar" tag="menu-sidebar" responsive >
|
2018-06-21 15:16:53 +03:00
|
|
|
<nb-sidebar-header *ngIf="currentTheme !== 'corporate'">
|
2017-09-29 19:34:07 +03:00
|
|
|
<a href="#" class="btn btn-hero-success main-btn">
|
2017-07-28 14:54:29 +03:00
|
|
|
<i class="ion ion-social-github"></i> <span>Support Us</span>
|
2017-09-18 19:48:11 +03:00
|
|
|
</a>
|
2017-08-01 17:42:21 +03:00
|
|
|
</nb-sidebar-header>
|
|
|
|
|
<ng-content select="nb-menu"></ng-content>
|
|
|
|
|
</nb-sidebar>
|
2017-07-28 14:54:29 +03:00
|
|
|
|
2017-08-01 17:42:21 +03:00
|
|
|
<nb-layout-column class="small">
|
|
|
|
|
</nb-layout-column>
|
2017-07-28 14:54:29 +03:00
|
|
|
|
2018-05-11 17:25:02 +03:00
|
|
|
<nb-layout-column>
|
2017-07-28 14:54:29 +03:00
|
|
|
<ng-content select="router-outlet"></ng-content>
|
2017-08-01 17:42:21 +03:00
|
|
|
</nb-layout-column>
|
2017-07-28 14:54:29 +03:00
|
|
|
|
2017-08-01 17:42:21 +03:00
|
|
|
<nb-layout-footer fixed>
|
2017-07-28 14:54:29 +03:00
|
|
|
<ngx-footer></ngx-footer>
|
2017-08-01 17:42:21 +03:00
|
|
|
</nb-layout-footer>
|
2017-07-28 14:54:29 +03:00
|
|
|
|
2017-08-01 17:42:21 +03:00
|
|
|
</nb-layout>
|
2017-07-28 14:54:29 +03:00
|
|
|
`,
|
|
|
|
|
})
|
2018-06-21 15:16:53 +03:00
|
|
|
export class TwoColumnsLayoutComponent implements OnDestroy {
|
|
|
|
|
|
|
|
|
|
private alive = true;
|
|
|
|
|
|
|
|
|
|
currentTheme: string;
|
|
|
|
|
|
|
|
|
|
constructor(protected themeService: NbThemeService) {
|
|
|
|
|
this.themeService.getJsTheme()
|
|
|
|
|
.pipe(takeWhile(() => this.alive))
|
|
|
|
|
.subscribe(theme => {
|
|
|
|
|
this.currentTheme = theme.name;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ngOnDestroy() {
|
|
|
|
|
this.alive = false;
|
|
|
|
|
}
|
2017-07-28 14:54:29 +03:00
|
|
|
}
|