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">
|
||||
import { Theme } from '$lib/constants';
|
||||
import { themeManager } from '$lib/managers/theme-manager.svelte';
|
||||
import { IconButton } from '@immich/ui';
|
||||
import { mdiWeatherNight, mdiWhiteBalanceSunny } from '@mdi/js';
|
||||
import { t } from 'svelte-i18n';
|
||||
|
||||
let icon = $derived(themeManager.isDark ? mdiWhiteBalanceSunny : mdiWeatherNight);
|
||||
import { ThemeSwitcher } from '@immich/ui';
|
||||
</script>
|
||||
|
||||
{#if !themeManager.theme.system}
|
||||
<IconButton
|
||||
aria-label={$t('toggle_theme')}
|
||||
{icon}
|
||||
role="switch"
|
||||
aria-checked={themeManager.isDark ? 'true' : 'false'}
|
||||
onclick={() => themeManager.toggleTheme()}
|
||||
<ThemeSwitcher
|
||||
size="medium"
|
||||
color="secondary"
|
||||
variant="ghost"
|
||||
shape="round"
|
||||
onChange={(theme) => themeManager.setTheme(theme == 'dark' ? Theme.DARK : Theme.LIGHT)}
|
||||
/>
|
||||
{/if}
|
||||
|
Loading…
x
Reference in New Issue
Block a user