import { useTransition, animated } from 'react-spring'; import { Button, Icon } from 'react-basics'; import { useIntl } from 'react-intl'; import useTheme from 'hooks/useTheme'; import Icons from 'components/icons'; import styles from './ThemeButton.module.css'; export default function ThemeButton() { const [theme, setTheme] = useTheme(); const transitions = useTransition(theme, { initial: { opacity: 1 }, from: { opacity: 0, transform: `translateY(${theme === 'light' ? '20px' : '-20px'}) scale(0.5)`, }, enter: { opacity: 1, transform: 'translateY(0px) scale(1.0)' }, leave: { opacity: 0, transform: `translateY(${theme === 'light' ? '-20px' : '20px'}) scale(0.5)`, }, }); function handleClick() { setTheme(theme === 'light' ? 'dark' : 'light'); } return ( ); }