2022-03-01 05:54:32 +01:00
|
|
|
import classNames from 'classnames';
|
2022-12-27 01:57:59 +01:00
|
|
|
import { Button, Icon } from 'react-basics';
|
2022-03-01 05:54:32 +01:00
|
|
|
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')}
|
2022-12-27 01:57:59 +01:00
|
|
|
>
|
|
|
|
<Icon>
|
|
|
|
<Sun />
|
|
|
|
</Icon>
|
|
|
|
</Button>
|
2022-03-01 05:54:32 +01:00
|
|
|
<Button
|
|
|
|
className={classNames({ [styles.active]: theme === 'dark' })}
|
|
|
|
onClick={() => setTheme('dark')}
|
2022-12-27 01:57:59 +01:00
|
|
|
>
|
|
|
|
<Icon>
|
|
|
|
<Moon />
|
|
|
|
</Icon>
|
|
|
|
</Button>
|
2022-03-01 05:54:32 +01:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|