import * as React from 'react'; import { FormLabel } from 'app/components/FormLabel'; import { Radio } from 'app/components/Radio'; import styled from 'styled-components/macro'; import { themeActions } from 'styles/theme/slice'; import { useDispatch, useSelector } from 'react-redux'; import { saveTheme } from 'styles/theme/utils'; import { ThemeKeyType } from 'styles/theme/slice/types'; import { selectThemeKey } from 'styles/theme/slice/selectors'; export function ThemeSwitch() { const theme = useSelector(selectThemeKey); const dispatch = useDispatch(); const handleThemeChange = (event: React.ChangeEvent) => { const value = event.target.value as ThemeKeyType; saveTheme(value); dispatch(themeActions.changeTheme(value)); }; return ( Select Theme ); } const Wrapper = styled.div` display: flex; flex-direction: column; ${FormLabel} { margin-bottom: 0.625rem; } `; const Themes = styled.div` display: flex; .radio { margin-right: 1.5rem; } `;