diff --git a/src/app/components/feed/feed.component.html b/src/app/components/feed/feed.component.html index cf41465..0c89f4d 100644 --- a/src/app/components/feed/feed.component.html +++ b/src/app/components/feed/feed.component.html @@ -16,9 +16,9 @@ I protected the environment.

- Did you support the environment? + What did you do? - the next time ;) + nothing ;) {{action.name}} diff --git a/src/app/components/main-navigation/main-navigation.component.html b/src/app/components/main-navigation/main-navigation.component.html index 4d7142e..d78ddee 100644 --- a/src/app/components/main-navigation/main-navigation.component.html +++ b/src/app/components/main-navigation/main-navigation.component.html @@ -55,29 +55,20 @@ - - - - diff --git a/src/app/components/main-navigation/main-navigation.component.ts b/src/app/components/main-navigation/main-navigation.component.ts index 9f90072..43dc4d3 100644 --- a/src/app/components/main-navigation/main-navigation.component.ts +++ b/src/app/components/main-navigation/main-navigation.component.ts @@ -27,7 +27,7 @@ export class MainNavigationComponent implements OnInit { profileUrl: string lighttheme : boolean = true - + overlay; isHandset$: Observable = this.breakpointObserver.observe(Breakpoints.Handset) .pipe( @@ -35,7 +35,9 @@ export class MainNavigationComponent implements OnInit { 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() { this.data.currentUserInfo.subscribe(user => { this.user = user @@ -61,15 +63,20 @@ export class MainNavigationComponent implements OnInit { { path: '/register', label: 'Register' }, ]; - public toggletheme(){ - if(this.lighttheme){ - this.onSetTheme("dark-theme"); - this.lighttheme = false; - } else{ - this.onSetTheme("light-theme"); - this.lighttheme = true; - } - } + toggleTheme() { + if (this.overlay.classList.contains("dark-theme")) { + this.overlay.classList.remove("dark-theme"); + this.overlay.classList.add("light-theme"); + this.onSetTheme("light-theme"); + } else if (this.overlay.classList.contains("light-theme")) { + 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; onSetTheme(theme) {