feat(theme): add corporate theme (#1727)

This commit is contained in:
Denis Strigo 2018-06-21 15:16:53 +03:00 committed by Dmitry Nehaychik
parent 6d705d2786
commit e37f12dfc9
45 changed files with 3747 additions and 2960 deletions

View file

@ -1,4 +1,6 @@
import { Component } from '@angular/core';
import { Component, OnDestroy } from '@angular/core';
import { NbThemeService } from '@nebular/theme';
import { takeWhile } from 'rxjs/operators/takeWhile';
// TODO: move layouts into the framework
@Component({
@ -11,7 +13,7 @@ import { Component } from '@angular/core';
</nb-layout-header>
<nb-sidebar class="menu-sidebar" tag="menu-sidebar" responsive >
<nb-sidebar-header>
<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>
@ -35,5 +37,21 @@ import { Component } from '@angular/core';
</nb-layout>
`,
})
export class ThreeColumnsLayoutComponent {
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;
}
}