Skip to content

Commit 755484a

Browse files
committed
settings back to AppTopBarHex*
1 parent cef9689 commit 755484a

File tree

4 files changed

+21
-11
lines changed

4 files changed

+21
-11
lines changed

src/app/app.component.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,16 @@ export class AppComponent implements OnDestroy {
147147

148148
setTheme(theme: Theme) {
149149
document.body.classList.toggle('darkMode', theme === Theme.DARK);
150-
const primaryColor = this.settingsService.settings?.AppPrimaryThemeColor || '#C41230';
151-
if (primaryColor) {
152-
document.documentElement.style.setProperty('--mat-sys-primary', primaryColor);
153-
document.body.style.setProperty('--mat-sys-primary', primaryColor);
154-
this.updateFavicon(primaryColor);
150+
const topBarColor = this.settingsService.settings?.AppTopBarHexColor || '#C41230';
151+
const topBarTextColor = this.settingsService.settings?.AppTopBarHexTextColor || '#FFFFFF';
152+
if (topBarColor) {
153+
document.documentElement.style.setProperty('--mat-sys-primary', topBarColor);
154+
document.body.style.setProperty('--mat-sys-primary', topBarColor);
155+
this.updateFavicon(topBarColor);
156+
}
157+
if (topBarTextColor) {
158+
document.documentElement.style.setProperty('--mat-sys-on-primary', topBarTextColor);
159+
document.body.style.setProperty('--mat-sys-on-primary', topBarTextColor);
155160
}
156161
}
157162

src/app/components/shared/top-bar/topbar.component.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
<mat-toolbar-row>
88
<span class="margin-auto">
99
@if (sidenav && sidenav?.opened) {
10-
<button aria-label="close sidebar" (click)="sidenavToggleFn()" mat-icon-button
11-
matTooltip="Close Sidebar" aria-label="Close Sidebar">
10+
<button aria-label="close sidebar" (click)="sidenavToggleFn()" mat-icon-button matTooltip="Close Sidebar"
11+
aria-label="Close Sidebar">
1212
<mat-icon svgIcon="ic_chevron_left_white_24px"></mat-icon>
1313
</button>
1414
}
1515
@if (sidenav && !sidenav?.opened) {
16-
<button aria-label="open sidebar" (click)="sidenavToggleFn()" mat-icon-button
17-
matTooltip="Open Sidebar" aria-label="Open Sidebar">
16+
<button aria-label="open sidebar" (click)="sidenavToggleFn()" mat-icon-button matTooltip="Open Sidebar"
17+
aria-label="Open Sidebar">
1818
<mat-icon svgIcon="ic_chevron_right_white_24px"></mat-icon>
1919
</button>
2020
}
@@ -51,7 +51,7 @@
5151
<div class="team-text">
5252
<button mat-button [matMenuTriggerFor]="menu" matTooltip="Menu" aria-label="Menu">
5353
<span class="username-text">{{ currentUser.profile.name }}</span>
54-
<mat-icon svgIcon="ic_expand_more_white_24px"></mat-icon>
54+
<mat-icon class="team-text" svgIcon="ic_expand_more_white_24px"></mat-icon>
5555
</button>
5656
<mat-menu #menu="matMenu" [overlapTrigger]="false" class="user-dropdown-menu">
5757
@if (team && showEditView$ | async) {

src/app/components/shared/top-bar/topbar.component.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,7 @@
4949
.mat-mdc-icon-button:not(:disabled) {
5050
color: var(--mat-sys-on-primary);
5151
}
52+
53+
mat-icon, .mat-icon {
54+
--mat-icon-color: var(--mat-sys-on-primary);
55+
}

src/assets/config/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
},
2020
"AppTitle": "Player",
2121
"AppTopBarText": "Player",
22-
"AppPrimaryThemeColor": "#3B62A5",
22+
"AppTopBarHexColor": "#3B62A5",
23+
"AppTopBarHexTextColor": "#FFFFFF",
2324
"UseLocalAuthStorage": false,
2425
"DebugLogging": false
2526
}

0 commit comments

Comments
 (0)