mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-17 07:50:12 +01:00
refactor(app): make a bit more neat structure
This commit is contained in:
parent
91c780c256
commit
44f2f562a9
20 changed files with 24 additions and 17 deletions
|
|
@ -0,0 +1,45 @@
|
|||
import { Component } from '@angular/core';
|
||||
|
||||
import { NgaSidebarService, NgaMenuService } from '@nga/theme';
|
||||
import { NgaThemeService } from '@nga/theme/services/theme.service';
|
||||
|
||||
@Component({
|
||||
selector: 'base-header',
|
||||
styleUrls: ['./base-header.component.scss'],
|
||||
template: `
|
||||
<div class="left">
|
||||
<i class="control-icon ion ion-navicon" (click)="toggleSidebar()"></i>
|
||||
<span class="logo" (click)="goToHome()">NgX <a>Admin</a></span>
|
||||
<button (click)="switchTheme()">Switch Theme!</button>
|
||||
</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>
|
||||
`,
|
||||
})
|
||||
export class BaseHeaderComponent {
|
||||
constructor(private sidebarService: NgaSidebarService,
|
||||
private menuService: NgaMenuService,
|
||||
private themeService: NgaThemeService) {
|
||||
}
|
||||
|
||||
toggleSidebar() {
|
||||
this.sidebarService.toggle(true);
|
||||
}
|
||||
|
||||
goToHome() {
|
||||
this.menuService.navigateHome();
|
||||
}
|
||||
|
||||
switchTheme() {
|
||||
if (this.themeService.currentTheme == 'pure') {
|
||||
this.themeService.changeTheme('gorgeous');
|
||||
} else {
|
||||
this.themeService.changeTheme('pure');
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue