From 8b0a05c207f400253f82b44b1f6d1a6863d61cc3 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Tue, 7 Nov 2023 14:16:44 -0600 Subject: [PATCH] Migrate settings to new hook --- src/view/screens/Settings.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/view/screens/Settings.tsx b/src/view/screens/Settings.tsx index 1970b7d4c3..620b6a345a 100644 --- a/src/view/screens/Settings.tsx +++ b/src/view/screens/Settings.tsx @@ -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) @@ -58,7 +58,7 @@ import {STATUS_PAGE_URL} from 'lib/constants' type Props = NativeStackScreenProps 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() @@ -381,23 +381,23 @@ export const SettingsScreen = withAuthRequired( persisted.setColorMode('system')} + onSelect={() => setColorMode('system')} accessibilityHint="Set color theme to system setting" /> persisted.setColorMode('light')} + onSelect={() => setColorMode('light')} accessibilityHint="Set color theme to light" /> persisted.setColorMode('dark')} + onSelect={() => setColorMode('dark')} accessibilityHint="Set color theme to dark" />