mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 14:47:14 +01:00
Updated theme handling.
This commit is contained in:
parent
c71e9b5707
commit
34a8fa100c
10 changed files with 57 additions and 93 deletions
|
|
@ -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 />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue