From ba95b857a7dde152b66bc6696e4d860a5ecf5bea Mon Sep 17 00:00:00 2001 From: Max Ehrlicher-Schmidt Date: Wed, 16 Dec 2020 18:40:40 +0100 Subject: [PATCH] Set dark theme as default --- src/app/app.component.ts | 4 ++-- .../pages/dataPages/participant/participant.component.html | 1 - src/app/services/colorTheme.service.ts | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 4d02afa..27a7a79 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -16,7 +16,7 @@ import { DomSanitizer } from '@angular/platform-browser'; }) export class AppComponent { title = 'fLotte-fRontend'; - darkThemeIsActive: boolean = false; + darkThemeIsActive: boolean = true; loggedIn = false; @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.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.matIconRegistry.addSvgIcon( "cargobike", diff --git a/src/app/pages/dataPages/participant/participant.component.html b/src/app/pages/dataPages/participant/participant.component.html index 4a956ce..db942fd 100644 --- a/src/app/pages/dataPages/participant/participant.component.html +++ b/src/app/pages/dataPages/participant/participant.component.html @@ -2,7 +2,6 @@ [dataService]="dataService" [propertiesInfo]="propertiesInfo" [getHeadline]="getHeadline" - [headlineDataPath]="headlineDataPath" [headlineIconName]="headlineIconName" [pageDataGQLType]="pageDataGQLType" [pageDataGQLUpdateInputType]="pageDataGQLUpdateInputType" diff --git a/src/app/services/colorTheme.service.ts b/src/app/services/colorTheme.service.ts index 04100aa..bad0c45 100644 --- a/src/app/services/colorTheme.service.ts +++ b/src/app/services/colorTheme.service.ts @@ -21,7 +21,7 @@ export class ColorThemeService { this.colorTheme = window.matchMedia('(prefers-color-theme: dark)').matches ? 'dark-theme' : 'light-theme'; } else { // If browser dont support prefers-color-theme, set it as default to dark - this.colorTheme = 'light-theme'; + this.colorTheme = 'dark-theme'; } }