Set dark theme as default

master
Max Ehrlicher-Schmidt 4 years ago
parent ba5b65741f
commit ba95b857a7

@ -16,7 +16,7 @@ import { DomSanitizer } from '@angular/platform-browser';
}) })
export class AppComponent { export class AppComponent {
title = 'fLotte-fRontend'; title = 'fLotte-fRontend';
darkThemeIsActive: boolean = false; darkThemeIsActive: boolean = true;
loggedIn = false; loggedIn = false;
@ViewChild('sidenav') public sideNav:MatSidenav; @ViewChild('sidenav') public sideNav:MatSidenav;
@ -36,7 +36,7 @@ export class AppComponent {
) { ) {
this.renderer.addClass(document.body, 'mat-app-background'); //so the background color changes dependent on current theme this.renderer.addClass(document.body, 'mat-app-background'); //so the background color changes dependent on current theme
this.themeService.load(); this.themeService.load();
this.darkThemeIsActive = this.themeService.currentActive() === 'dark-theme'; this.darkThemeIsActive = this.themeService.currentActive() !== 'light-theme';
this.authService.loggedIn.subscribe((value) => (this.loggedIn = value)); this.authService.loggedIn.subscribe((value) => (this.loggedIn = value));
this.matIconRegistry.addSvgIcon( this.matIconRegistry.addSvgIcon(
"cargobike", "cargobike",

@ -2,7 +2,6 @@
[dataService]="dataService" [dataService]="dataService"
[propertiesInfo]="propertiesInfo" [propertiesInfo]="propertiesInfo"
[getHeadline]="getHeadline" [getHeadline]="getHeadline"
[headlineDataPath]="headlineDataPath"
[headlineIconName]="headlineIconName" [headlineIconName]="headlineIconName"
[pageDataGQLType]="pageDataGQLType" [pageDataGQLType]="pageDataGQLType"
[pageDataGQLUpdateInputType]="pageDataGQLUpdateInputType" [pageDataGQLUpdateInputType]="pageDataGQLUpdateInputType"

@ -21,7 +21,7 @@ export class ColorThemeService {
this.colorTheme = window.matchMedia('(prefers-color-theme: dark)').matches ? 'dark-theme' : 'light-theme'; this.colorTheme = window.matchMedia('(prefers-color-theme: dark)').matches ? 'dark-theme' : 'light-theme';
} else { } else {
// If browser dont support prefers-color-theme, set it as default to dark // If browser dont support prefers-color-theme, set it as default to dark
this.colorTheme = 'light-theme'; this.colorTheme = 'dark-theme';
} }
} }

Loading…
Cancel
Save