mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 09:45:04 +01:00
e1f99a7d01
* Rewrite admin. * Clean up password forms. * Fix naming issues. * CSS Naming.
32 lines
787 B
JavaScript
32 lines
787 B
JavaScript
import classNames from 'classnames';
|
|
import { Button, Icon } from 'react-basics';
|
|
import useTheme from 'hooks/useTheme';
|
|
import Sun from 'assets/sun.svg';
|
|
import Moon from 'assets/moon.svg';
|
|
import styles from './ThemeSetting.module.css';
|
|
|
|
export default function ThemeSetting() {
|
|
const [theme, setTheme] = useTheme();
|
|
|
|
return (
|
|
<div className={styles.buttons}>
|
|
<Button
|
|
className={classNames({ [styles.active]: theme === 'light' })}
|
|
onClick={() => setTheme('light')}
|
|
>
|
|
<Icon>
|
|
<Sun />
|
|
</Icon>
|
|
</Button>
|
|
<Button
|
|
className={classNames({ [styles.active]: theme === 'dark' })}
|
|
onClick={() => setTheme('dark')}
|
|
>
|
|
<Icon>
|
|
<Moon />
|
|
</Icon>
|
|
</Button>
|
|
</div>
|
|
);
|
|
}
|