|
|
@ -27,7 +27,7 @@ export class MainNavigationComponent implements OnInit {
|
|
|
|
profileUrl: string
|
|
|
|
profileUrl: string
|
|
|
|
|
|
|
|
|
|
|
|
lighttheme : boolean = true
|
|
|
|
lighttheme : boolean = true
|
|
|
|
|
|
|
|
overlay;
|
|
|
|
|
|
|
|
|
|
|
|
isHandset$: Observable<boolean> = this.breakpointObserver.observe(Breakpoints.Handset)
|
|
|
|
isHandset$: Observable<boolean> = this.breakpointObserver.observe(Breakpoints.Handset)
|
|
|
|
.pipe(
|
|
|
|
.pipe(
|
|
|
@ -35,7 +35,9 @@ export class MainNavigationComponent implements OnInit {
|
|
|
|
shareReplay()
|
|
|
|
shareReplay()
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
constructor(public overlayContainer: OverlayContainer, private data: DatasharingService,private selfservice: SelfService,private breakpointObserver: BreakpointObserver, private http: Http, private router: Router) {}
|
|
|
|
constructor(public overlayContainer: OverlayContainer, private data: DatasharingService,private selfservice: SelfService,private breakpointObserver: BreakpointObserver, private http: Http, private router: Router) {
|
|
|
|
|
|
|
|
this.overlay = overlayContainer.getContainerElement();
|
|
|
|
|
|
|
|
}
|
|
|
|
ngOnInit() {
|
|
|
|
ngOnInit() {
|
|
|
|
this.data.currentUserInfo.subscribe(user => {
|
|
|
|
this.data.currentUserInfo.subscribe(user => {
|
|
|
|
this.user = user
|
|
|
|
this.user = user
|
|
|
@ -61,15 +63,20 @@ export class MainNavigationComponent implements OnInit {
|
|
|
|
{ path: '/register', label: 'Register' },
|
|
|
|
{ path: '/register', label: 'Register' },
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
public toggletheme(){
|
|
|
|
toggleTheme() {
|
|
|
|
if(this.lighttheme){
|
|
|
|
if (this.overlay.classList.contains("dark-theme")) {
|
|
|
|
this.onSetTheme("dark-theme");
|
|
|
|
this.overlay.classList.remove("dark-theme");
|
|
|
|
this.lighttheme = false;
|
|
|
|
this.overlay.classList.add("light-theme");
|
|
|
|
} else{
|
|
|
|
this.onSetTheme("light-theme");
|
|
|
|
this.onSetTheme("light-theme");
|
|
|
|
} else if (this.overlay.classList.contains("light-theme")) {
|
|
|
|
this.lighttheme = true;
|
|
|
|
this.overlay.classList.remove("light-theme");
|
|
|
|
|
|
|
|
this.overlay.classList.add("dark-theme");
|
|
|
|
|
|
|
|
this.onSetTheme("dark-theme");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.overlay.classList.add("dark-theme");
|
|
|
|
|
|
|
|
this.onSetTheme("dark-theme");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@HostBinding('class') componentCssClass;
|
|
|
|
@HostBinding('class') componentCssClass;
|
|
|
|
onSetTheme(theme) {
|
|
|
|
onSetTheme(theme) {
|
|
|
|