diff --git a/packages/components/src/components/widgets/ThemePreference.tsx b/packages/components/src/components/widgets/ThemePreference.tsx index 4e557b8b..b3f10859 100644 --- a/packages/components/src/components/widgets/ThemePreference.tsx +++ b/packages/components/src/components/widgets/ThemePreference.tsx @@ -5,13 +5,13 @@ import { Theme } from '@devhub/core' import { useCSSVariablesOrSpringAnimatedTheme } from '../../hooks/use-css-variables-or-spring--animated-theme' import { useReduxAction } from '../../hooks/use-redux-action' import { useReduxState } from '../../hooks/use-redux-state' -import { Platform } from '../../libs/platform' import * as actions from '../../redux/actions' import * as selectors from '../../redux/selectors' import { darkThemesArr, lightThemesArr } from '../../styles/themes' import { defaultTheme } from '../../styles/utils' import { contentPadding } from '../../styles/variables' import { SpringAnimatedText } from '../animated/spring/SpringAnimatedText' +import { SpringAnimatedCheckbox } from '../common/Checkbox' import { H3 } from '../common/H3' import { Spacer } from '../common/Spacer' import { SubHeader } from '../common/SubHeader' @@ -52,84 +52,28 @@ export const ThemePreference = React.memo(() => { : theme.id === preferredLightThemeId)) return ( - { - setTheme({ - id: theme.id, - color: theme.backgroundColor, - }) - }} - style={{ + key={`theme-item-checkbox-${theme.id}`} + checked={selected ? (currentThemeId === 'auto' ? null : true) : false} + circle + containerStyle={{ marginBottom: contentPadding / 2, }} - > - - - - {selected - ? currentThemeId === 'auto' - ? theme.isDark - ? '◒' - : '◓' - : '◉' - : '○'} - - - - - {theme.displayName} - - - + enableIndeterminateState={currentThemeId === 'auto'} + label={theme.displayName} + onChange={checked => { + if ( + checked === true || + (currentThemeId === 'auto' && checked === null) + ) { + setTheme({ + id: theme.id, + color: theme.backgroundColor, + }) + } + }} + /> ) }