Skip to content

Commit

Permalink
Migrate settings to new hook
Browse files Browse the repository at this point in the history
  • Loading branch information
estrattonbailey committed Nov 7, 2023
1 parent d9d7b78 commit 8b0a05c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/view/screens/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import Clipboard from '@react-native-clipboard/clipboard'
import {makeProfileLink} from 'lib/routes/links'
import {AccountDropdownBtn} from 'view/com/util/AccountDropdownBtn'
import {logger} from '#/logger'
import {usePersisted} from '#/state/persisted'
import {useColorMode} from '#/state/colorMode'
import {useSetMinimalShellMode} from '#/state/shell'

// TEMPORARY (APP-700)
Expand All @@ -58,7 +58,7 @@ import {STATUS_PAGE_URL} from 'lib/constants'
type Props = NativeStackScreenProps<CommonNavigatorParams, 'Settings'>
export const SettingsScreen = withAuthRequired(
observer(function Settings({}: Props) {
const persisted = usePersisted()
const {colorMode, setColorMode} = useColorMode()
const pal = usePalette('default')
const store = useStores()
const setMinimalShellMode = useSetMinimalShellMode()
Expand Down Expand Up @@ -381,23 +381,23 @@ export const SettingsScreen = withAuthRequired(
<View>
<View style={[styles.linkCard, pal.view, styles.selectableBtns]}>
<SelectableBtn
selected={persisted.colorMode === 'system'}
selected={colorMode === 'system'}
label="System"
left
onSelect={() => persisted.setColorMode('system')}
onSelect={() => setColorMode('system')}
accessibilityHint="Set color theme to system setting"
/>
<SelectableBtn
selected={persisted.colorMode === 'light'}
selected={colorMode === 'light'}
label="Light"
onSelect={() => persisted.setColorMode('light')}
onSelect={() => setColorMode('light')}
accessibilityHint="Set color theme to light"
/>
<SelectableBtn
selected={persisted.colorMode === 'dark'}
selected={colorMode === 'dark'}
label="Dark"
right
onSelect={() => persisted.setColorMode('dark')}
onSelect={() => setColorMode('dark')}
accessibilityHint="Set color theme to dark"
/>
</View>
Expand Down

0 comments on commit 8b0a05c

Please sign in to comment.