mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-19 08:50:13 +01:00
Profile creation part done.
This commit is contained in:
parent
39385049e5
commit
f75e93e3eb
10 changed files with 1000 additions and 486 deletions
|
|
@ -1,10 +1,11 @@
|
|||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { NbMediaBreakpointsService, NbMenuService, NbSidebarService, NbThemeService } from '@nebular/theme';
|
||||
import { NbMediaBreakpointsService, NbMenuService, NbSidebarService, NbThemeService, NbMenuItem } from '@nebular/theme';
|
||||
|
||||
import { UserData } from '../../../@core/data/users';
|
||||
import { LayoutService } from '../../../@core/utils';
|
||||
import { map, takeUntil } from 'rxjs/operators';
|
||||
import { Subject } from 'rxjs';
|
||||
import { AuthService } from '../../../service/auth.service';
|
||||
|
||||
@Component({
|
||||
selector: 'ngx-header',
|
||||
|
|
@ -26,14 +27,14 @@ export class HeaderComponent implements OnInit, OnDestroy {
|
|||
value: 'dark',
|
||||
name: 'Dark',
|
||||
},
|
||||
{
|
||||
value: 'cosmic',
|
||||
name: 'Cosmic',
|
||||
},
|
||||
{
|
||||
value: 'corporate',
|
||||
name: 'Corporate',
|
||||
},
|
||||
// {
|
||||
// value: 'cosmic',
|
||||
// name: 'Cosmic',
|
||||
// },
|
||||
// {
|
||||
// value: 'corporate',
|
||||
// name: 'Corporate',
|
||||
// },
|
||||
];
|
||||
|
||||
currentTheme = 'default';
|
||||
|
|
@ -45,7 +46,8 @@ export class HeaderComponent implements OnInit, OnDestroy {
|
|||
private themeService: NbThemeService,
|
||||
private userService: UserData,
|
||||
private layoutService: LayoutService,
|
||||
private breakpointService: NbMediaBreakpointsService) {
|
||||
private breakpointService: NbMediaBreakpointsService,
|
||||
private authService: AuthService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
|
@ -69,6 +71,12 @@ export class HeaderComponent implements OnInit, OnDestroy {
|
|||
takeUntil(this.destroy$),
|
||||
)
|
||||
.subscribe(themeName => this.currentTheme = themeName);
|
||||
|
||||
this.menuService.onItemClick().subscribe((event: { item: NbMenuItem }) => {
|
||||
if (event.item.title === 'Log out') {
|
||||
this.logout();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
|
|
@ -91,4 +99,8 @@ export class HeaderComponent implements OnInit, OnDestroy {
|
|||
this.menuService.navigateHome();
|
||||
return false;
|
||||
}
|
||||
|
||||
logout(): void {
|
||||
this.authService.logout();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue