mirror of
https://github.com/akveo/ngx-admin.git
synced 2026-01-16 06:25:29 +01:00
Implement ripple effect for material themes
This commit is contained in:
parent
c7bcbca7bd
commit
2f7d61ded1
12 changed files with 334 additions and 15 deletions
|
|
@ -2,8 +2,10 @@ import { Component, OnDestroy, OnInit } from '@angular/core';
|
|||
import { NbMediaBreakpointsService, NbMenuService, NbSidebarService, NbThemeService } 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 { RippleService } from '../../../@core/utils/ripple.service';
|
||||
|
||||
@Component({
|
||||
selector: 'ngx-header',
|
||||
|
|
@ -51,7 +53,9 @@ export class HeaderComponent implements OnInit, OnDestroy {
|
|||
private menuService: NbMenuService,
|
||||
private themeService: NbThemeService,
|
||||
private userService: UserData,
|
||||
private breakpointService: NbMediaBreakpointsService) {
|
||||
private layoutService: LayoutService,
|
||||
private breakpointService: NbMediaBreakpointsService,
|
||||
private rippleService: RippleService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
|
@ -74,7 +78,10 @@ export class HeaderComponent implements OnInit, OnDestroy {
|
|||
map(({ name }) => name),
|
||||
takeUntil(this.destroy$),
|
||||
)
|
||||
.subscribe(themeName => this.currentTheme = themeName);
|
||||
.subscribe(themeName => {
|
||||
this.currentTheme = themeName;
|
||||
this.rippleService.toggle(themeName?.startsWith('material'));
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
|
|
@ -88,6 +95,7 @@ export class HeaderComponent implements OnInit, OnDestroy {
|
|||
|
||||
toggleSidebar(): boolean {
|
||||
this.sidebarService.toggle(true, 'menu-sidebar');
|
||||
this.layoutService.changeLayoutSize();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue