mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 15:47:13 +01:00
More refactoring.
This commit is contained in:
parent
5f15ad0807
commit
02a1438cfe
41 changed files with 196 additions and 721 deletions
|
|
@ -2,7 +2,7 @@ import { useTransition, animated } from 'react-spring';
|
|||
import { Button, Icon, PopupTrigger, Tooltip } from 'react-basics';
|
||||
import { useIntl } from 'react-intl';
|
||||
import useTheme from 'hooks/useTheme';
|
||||
import { Sun, Moon } from 'components/icons';
|
||||
import Icons from 'components/icons';
|
||||
import { labels } from 'components/messages';
|
||||
import styles from './ThemeButton.module.css';
|
||||
|
||||
|
|
@ -28,11 +28,11 @@ export default function ThemeButton({ tooltipPosition = 'top' }) {
|
|||
}
|
||||
|
||||
return (
|
||||
<PopupTrigger action="hover" popupProps={{ position: 'top' }}>
|
||||
<PopupTrigger action="hover">
|
||||
<Button variant="quiet" className={styles.button} onClick={handleClick}>
|
||||
{transitions((style, item) => (
|
||||
<animated.div key={item} style={style}>
|
||||
<Icon className={styles.icon}>{item === 'light' ? <Sun /> : <Moon />}</Icon>
|
||||
<Icon className={styles.icon}>{item === 'light' ? <Icons.Sun /> : <Icons.Moon />}</Icon>
|
||||
</animated.div>
|
||||
))}
|
||||
</Button>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue