feat(navigation): switch theme
This commit is contained in:
@@ -62,9 +62,15 @@
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<div class="options flex flex-row gap-[10px]">
|
<div class="options flex flex-row gap-[10px]">
|
||||||
<div class="dark-mode size-[50px]">
|
@if (themeSwitchService.darkMode()) {
|
||||||
|
<div class="dark-mode size-[50px]" (click)="themeSwitchService.switchToLight()">
|
||||||
<fa-icon [icon]="faMoon"/>
|
<fa-icon [icon]="faMoon"/>
|
||||||
</div>
|
</div>
|
||||||
|
} @else {
|
||||||
|
<div class="dark-mode size-[50px]" (click)="themeSwitchService.switchToDark()">
|
||||||
|
<fa-icon [icon]="faSun"/>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
<div class="language size-[50px]">EN</div>
|
<div class="language size-[50px]">EN</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
@@ -52,4 +52,12 @@ export class ThemeSwitchService {
|
|||||||
console.info(`switching to theme: ${theme.name}`);
|
console.info(`switching to theme: ${theme.name}`);
|
||||||
this.theme.set(theme);
|
this.theme.set(theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switchToDark() {
|
||||||
|
this.switchToTheme(Theme.THEMES.find(t => t.code === 'dark')!);
|
||||||
|
}
|
||||||
|
|
||||||
|
switchToLight() {
|
||||||
|
this.switchToTheme(Theme.THEMES.find(t => t.code === 'light')!);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user