refractor(theme): set the theme from login and update default theme to (#128)

denim-yellowgreen

Set the theme from the login page itself if present in local storage and
update default theme to denim-yellowgreen (based on logo of Mifos).

Fixes #127
This commit is contained in:
Abhay Chawla
2018-07-15 00:52:02 +05:30
committed by GitHub
parent 80e82677de
commit 3c9d012e8c
4 changed files with 43 additions and 35 deletions
+7
View File
@@ -9,6 +9,7 @@ import { filter, map, mergeMap } from 'rxjs/operators';
import { environment } from '../environments/environment';
import { Logger, I18nService } from './core';
import { ThemeStorageService } from './core/shell/toolbar/theme-picker/theme-storage.service';
import { AlertService } from './core/alert.service';
const log = new Logger('MifosX');
@@ -25,6 +26,7 @@ export class WebAppComponent implements OnInit {
private titleService: Title,
private translateService: TranslateService,
private i18nService: I18nService,
private themeStorageService: ThemeStorageService,
public snackBar: MatSnackBar,
private alertService: AlertService) { }
@@ -61,6 +63,11 @@ export class WebAppComponent implements OnInit {
}
});
const theme = this.themeStorageService.getTheme();
if (theme) {
this.themeStorageService.installTheme(theme);
}
this.alertService.alertEvent.subscribe((alertEvent: any) => {
this.snackBar.open(`${alertEvent.message}`, 'Close', {
duration: 2000,