2017-04-18 19:12:29 +03:00
|
|
|
import { Component } from '@angular/core';
|
|
|
|
|
|
2017-04-21 17:23:44 +03:00
|
|
|
import { NgaSidebarService, NgaMenuService } from '@nga/theme';
|
2017-04-26 08:59:57 +03:00
|
|
|
import { NgaThemeService } from '@nga/theme/services/theme.service';
|
2017-04-18 19:12:29 +03:00
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'base-header',
|
|
|
|
|
styleUrls: ['./base-header.component.scss'],
|
|
|
|
|
template: `
|
|
|
|
|
<div class="left">
|
|
|
|
|
<i class="control-icon ion ion-navicon" (click)="toggleSidebar()"></i>
|
2017-04-26 08:59:57 +03:00
|
|
|
<span class="logo" (click)="goToHome()">NgX <a>Admin</a></span>
|
|
|
|
|
<button (click)="switchTheme()">Switch Theme!</button>
|
2017-04-18 19:12:29 +03:00
|
|
|
</div>
|
|
|
|
|
<div class="right">
|
|
|
|
|
<search-input></search-input>
|
|
|
|
|
<i class="control-icon ion ion-ios-email-outline"></i>
|
|
|
|
|
<i class="control-icon ion ion-ios-bell-outline"></i>
|
|
|
|
|
<nga-user></nga-user>
|
|
|
|
|
<i class="control-icon ion ion-ios-gear-outline"></i>
|
|
|
|
|
</div>
|
2017-04-21 17:23:44 +03:00
|
|
|
`,
|
2017-04-18 19:12:29 +03:00
|
|
|
})
|
|
|
|
|
export class BaseHeaderComponent {
|
2017-04-21 17:23:44 +03:00
|
|
|
constructor(private sidebarService: NgaSidebarService,
|
2017-04-26 08:59:57 +03:00
|
|
|
private menuService: NgaMenuService,
|
|
|
|
|
private themeService: NgaThemeService) {
|
2017-04-18 19:12:29 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
toggleSidebar() {
|
|
|
|
|
this.sidebarService.toggle(true);
|
|
|
|
|
}
|
2017-04-21 17:23:44 +03:00
|
|
|
|
|
|
|
|
goToHome() {
|
|
|
|
|
this.menuService.navigateHome();
|
|
|
|
|
}
|
2017-04-26 08:59:57 +03:00
|
|
|
|
|
|
|
|
switchTheme() {
|
|
|
|
|
if (this.themeService.currentTheme == 'pure') {
|
|
|
|
|
this.themeService.changeTheme('gorgeous');
|
|
|
|
|
} else {
|
|
|
|
|
this.themeService.changeTheme('pure');
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-04-18 19:12:29 +03:00
|
|
|
}
|