Login view with the support of dark theme
This commit is contained in:
committed by
Jose Alberto Hernandez
parent
e232ab2e3a
commit
f8bbd270f5
@@ -0,0 +1,30 @@
|
||||
import { Component, OnChanges, OnInit, SimpleChanges } from '@angular/core';
|
||||
import { ThemingService } from './theming.service';
|
||||
|
||||
@Component({
|
||||
selector: 'mifosx-theme-toggle',
|
||||
templateUrl: './theme-toggle.component.html',
|
||||
styleUrls: ['./theme-toggle.component.scss']
|
||||
})
|
||||
export class ThemeToggleComponent implements OnInit, OnChanges {
|
||||
|
||||
darkModeOn: boolean;
|
||||
|
||||
constructor(private themingService: ThemingService) {
|
||||
this.darkModeOn = this.themingService.isDarkMode();
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.darkModeOn = this.themingService.isDarkMode();
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
this.darkModeOn = this.themingService.isDarkMode();
|
||||
}
|
||||
|
||||
toggleTheme() {
|
||||
this.darkModeOn = !this.darkModeOn;
|
||||
this.themingService.setDarkMode(this.darkModeOn);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user