Updated theme handling.

This commit is contained in:
Mike Cao 2025-04-01 22:58:38 -05:00
parent c71e9b5707
commit 34a8fa100c
10 changed files with 57 additions and 93 deletions

View file

@ -1,17 +1,16 @@
import classNames from 'classnames';
import { Button, Icon } from '@umami/react-zen';
import { useTheme } from '@/components/hooks';
import { Button, Icon, useTheme } from '@umami/react-zen';
import { Icons } from '@/components/icons';
import styles from './ThemeSetting.module.css';
export function ThemeSetting() {
const { theme, saveTheme } = useTheme();
const { theme, setTheme } = useTheme();
return (
<div className={styles.buttons}>
<Button
className={classNames({ [styles.active]: theme === 'light' })}
onPress={() => saveTheme('light')}
onPress={() => setTheme('light')}
>
<Icon>
<Icons.Sun />
@ -19,7 +18,7 @@ export function ThemeSetting() {
</Button>
<Button
className={classNames({ [styles.active]: theme === 'dark' })}
onPress={() => saveTheme('dark')}
onPress={() => setTheme('dark')}
>
<Icon>
<Icons.Moon />