import variables from 'config/variables'; import { useState } from 'react'; import { MdAutoAwesome, MdLightMode, MdDarkMode } from 'react-icons/md'; import { loadSettings } from 'modules/helpers/settings'; import { Header } from '../components/Layout'; function ThemeSelection() { const [theme, setTheme] = useState({ autoClass: 'toggle auto active', lightClass: 'toggle lightTheme', darkClass: 'toggle darkTheme', }); const changeTheme = (type) => { setTheme({ autoClass: type === 'auto' ? 'toggle auto active' : 'toggle auto', lightClass: type === 'light' ? 'toggle lightTheme active' : 'toggle lightTheme', darkClass: type === 'dark' ? 'toggle darkTheme active' : 'toggle darkTheme', }); localStorage.setItem('theme', type); loadSettings(true); }; return ( <>
changeTheme('auto')}> {variables.getMessage('modals.main.settings.sections.appearance.theme.auto')}
changeTheme('light')}> {variables.getMessage('modals.main.settings.sections.appearance.theme.light')}
changeTheme('dark')}> {variables.getMessage('modals.main.settings.sections.appearance.theme.dark')}
{variables.getMessage('modals.welcome.tip')} {variables.getMessage('modals.welcome.sections.theme.tip')} ); } export { ThemeSelection as default, ThemeSelection };