added different themes, issue with ngrx

This commit is contained in:
lotte
2019-03-25 10:41:56 +01:00
committed by Art Lowel
parent 6ba7fb34fa
commit a4a4be9983
11 changed files with 144 additions and 4 deletions

View File

@@ -32,7 +32,9 @@ import { Observable } from 'rxjs/internal/Observable';
import { slideSidebarPadding } from './shared/animations/slide';
import { combineLatest as combineLatestObservable, of } from 'rxjs';
import { HostWindowService } from './shared/host-window.service';
import { ThemeService } from './core/theme/theme.service';
import { Theme } from '../config/theme.inferface';
import { isNotEmpty } from './shared/empty.util';
@Component({
selector: 'ds-app',
@@ -63,6 +65,7 @@ export class AppComponent implements OnInit, AfterViewInit {
private cssService: CSSVariableService,
private menuService: MenuService,
private windowService: HostWindowService,
private themeService: ThemeService
) {
// Load all the languages that are defined as active from the config file
@@ -89,6 +92,11 @@ export class AppComponent implements OnInit, AfterViewInit {
}
ngOnInit() {
const availableThemes: Theme[] = this.config.themes;
if (isNotEmpty(availableThemes)) {
this.themeService.setCurrentTheme(availableThemes[0]);
}
this.theme = this.themeService.getCurrentTheme();
const env: string = this.config.production ? 'Production' : 'Development';
const color: string = this.config.production ? 'red' : 'green';