mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-25 03:40:13 +01:00
56 lines
1.5 KiB
TypeScript
56 lines
1.5 KiB
TypeScript
import { Component, OnDestroy } from '@angular/core';
|
|
import { NbThemeService } from '@nebular/theme';
|
|
import { takeWhile } from 'rxjs/operators';
|
|
|
|
@Component({
|
|
selector: 'ngx-three-columns-layout',
|
|
styleUrls: ['./three-columns.layout.scss'],
|
|
template: `
|
|
<nb-layout>
|
|
<nb-layout-header fixed>
|
|
<ngx-header></ngx-header>
|
|
</nb-layout-header>
|
|
|
|
<nb-sidebar class="menu-sidebar" tag="menu-sidebar" responsive >
|
|
<nb-sidebar-header *ngIf="currentTheme !== 'corporate'">
|
|
<a href="#" class="btn btn-hero-success main-btn">
|
|
<i class="ion ion-social-github"></i> <span>Support Us</span>
|
|
</a>
|
|
</nb-sidebar-header>
|
|
<ng-content select="nb-menu"></ng-content>
|
|
</nb-sidebar>
|
|
|
|
<nb-layout-column class="small">
|
|
</nb-layout-column>
|
|
|
|
<nb-layout-column>
|
|
<ng-content select="router-outlet"></ng-content>
|
|
</nb-layout-column>
|
|
|
|
<nb-layout-column class="small">
|
|
</nb-layout-column>
|
|
|
|
<nb-layout-footer fixed>
|
|
<ngx-footer></ngx-footer>
|
|
</nb-layout-footer>
|
|
</nb-layout>
|
|
`,
|
|
})
|
|
export class ThreeColumnsLayoutComponent 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;
|
|
}
|
|
}
|