mirror of
https://github.com/immich-app/immich.git
synced 2025-07-09 03:04:16 -04:00
use theme switcher from UI lib
This commit is contained in:
parent
4b2a8ea97d
commit
22e9d8ec6d
@ -1,21 +1,13 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { Theme } from '$lib/constants';
|
||||||
import { themeManager } from '$lib/managers/theme-manager.svelte';
|
import { themeManager } from '$lib/managers/theme-manager.svelte';
|
||||||
import { IconButton } from '@immich/ui';
|
import { ThemeSwitcher } from '@immich/ui';
|
||||||
import { mdiWeatherNight, mdiWhiteBalanceSunny } from '@mdi/js';
|
|
||||||
import { t } from 'svelte-i18n';
|
|
||||||
|
|
||||||
let icon = $derived(themeManager.isDark ? mdiWhiteBalanceSunny : mdiWeatherNight);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if !themeManager.theme.system}
|
{#if !themeManager.theme.system}
|
||||||
<IconButton
|
<ThemeSwitcher
|
||||||
aria-label={$t('toggle_theme')}
|
size="medium"
|
||||||
{icon}
|
|
||||||
role="switch"
|
|
||||||
aria-checked={themeManager.isDark ? 'true' : 'false'}
|
|
||||||
onclick={() => themeManager.toggleTheme()}
|
|
||||||
color="secondary"
|
color="secondary"
|
||||||
variant="ghost"
|
onChange={(theme) => themeManager.setTheme(theme == 'dark' ? Theme.DARK : Theme.LIGHT)}
|
||||||
shape="round"
|
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user