From 3c22ca39ffe9a49cdc1e902e3da38df2e3ace335 Mon Sep 17 00:00:00 2001 From: GCyganek Date: Wed, 8 Oct 2025 10:43:59 +0200 Subject: [PATCH 1/2] Make ThemePage use new SelectionList --- src/pages/settings/Preferences/ThemePage.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pages/settings/Preferences/ThemePage.tsx b/src/pages/settings/Preferences/ThemePage.tsx index 121391dbac96..6bf2b08bfe87 100644 --- a/src/pages/settings/Preferences/ThemePage.tsx +++ b/src/pages/settings/Preferences/ThemePage.tsx @@ -2,9 +2,9 @@ import React, {useRef} from 'react'; import type {ValueOf} from 'type-fest'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; import ScreenWrapper from '@components/ScreenWrapper'; -import SelectionList from '@components/SelectionListWithSections'; -import RadioListItem from '@components/SelectionListWithSections/RadioListItem'; -import type {ListItem} from '@components/SelectionListWithSections/types'; +import SelectionList from '@components/SelectionList'; +import RadioListItem from '@components/SelectionList/ListItem/RadioListItem'; +import type {ListItem} from '@components/SelectionList/ListItem/types'; import Text from '@components/Text'; import useLocalize from '@hooks/useLocalize'; import useOnyx from '@hooks/useOnyx'; @@ -50,11 +50,11 @@ function ThemePage() { /> {translate('themePage.chooseThemeBelowOrSync')} theme.isSelected)?.keyForList} + initiallyFocusedItemKey={localesToThemes.find((theme) => theme.isSelected)?.keyForList} /> ); From a873bd0246d72e74b6fdfc5af1dc92a938e1d88b Mon Sep 17 00:00:00 2001 From: GCyganek Date: Wed, 8 Oct 2025 14:55:41 +0200 Subject: [PATCH 2/2] Fix useOnyx canBeMissing usage --- src/pages/settings/Preferences/ThemePage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/settings/Preferences/ThemePage.tsx b/src/pages/settings/Preferences/ThemePage.tsx index 6bf2b08bfe87..af4d3f7b9c04 100644 --- a/src/pages/settings/Preferences/ThemePage.tsx +++ b/src/pages/settings/Preferences/ThemePage.tsx @@ -21,7 +21,7 @@ type ThemeEntry = ListItem & { function ThemePage() { const styles = useThemeStyles(); const {translate} = useLocalize(); - const [preferredTheme] = useOnyx(ONYXKEYS.PREFERRED_THEME); + const [preferredTheme] = useOnyx(ONYXKEYS.PREFERRED_THEME, {canBeMissing: true}); const isOptionSelected = useRef(false); const {DEFAULT, FALLBACK, ...themes} = CONST.THEME; const localesToThemes = Object.values(themes).map((theme) => ({