Skip to content

Commit be99e70

Browse files
authored
Merge pull request #72074 from software-mansion-labs/@GCyganek/migrate-ThemePage-SelectionList
Make `ThemePage` use new `SelectionList`
2 parents 780811d + a873bd0 commit be99e70

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/pages/settings/Preferences/ThemePage.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import React, {useRef} from 'react';
22
import type {ValueOf} from 'type-fest';
33
import HeaderWithBackButton from '@components/HeaderWithBackButton';
44
import ScreenWrapper from '@components/ScreenWrapper';
5-
import SelectionList from '@components/SelectionListWithSections';
6-
import RadioListItem from '@components/SelectionListWithSections/RadioListItem';
7-
import type {ListItem} from '@components/SelectionListWithSections/types';
5+
import SelectionList from '@components/SelectionList';
6+
import RadioListItem from '@components/SelectionList/ListItem/RadioListItem';
7+
import type {ListItem} from '@components/SelectionList/ListItem/types';
88
import Text from '@components/Text';
99
import useLocalize from '@hooks/useLocalize';
1010
import useOnyx from '@hooks/useOnyx';
@@ -21,7 +21,7 @@ type ThemeEntry = ListItem & {
2121
function ThemePage() {
2222
const styles = useThemeStyles();
2323
const {translate} = useLocalize();
24-
const [preferredTheme] = useOnyx(ONYXKEYS.PREFERRED_THEME);
24+
const [preferredTheme] = useOnyx(ONYXKEYS.PREFERRED_THEME, {canBeMissing: true});
2525
const isOptionSelected = useRef(false);
2626
const {DEFAULT, FALLBACK, ...themes} = CONST.THEME;
2727
const localesToThemes = Object.values(themes).map((theme) => ({
@@ -50,11 +50,11 @@ function ThemePage() {
5050
/>
5151
<Text style={[styles.mh5, styles.mv4]}>{translate('themePage.chooseThemeBelowOrSync')}</Text>
5252
<SelectionList
53-
sections={[{data: localesToThemes}]}
53+
data={localesToThemes}
5454
ListItem={RadioListItem}
5555
onSelectRow={updateTheme}
5656
shouldSingleExecuteRowSelect
57-
initiallyFocusedOptionKey={localesToThemes.find((theme) => theme.isSelected)?.keyForList}
57+
initiallyFocusedItemKey={localesToThemes.find((theme) => theme.isSelected)?.keyForList}
5858
/>
5959
</ScreenWrapper>
6060
);

0 commit comments

Comments
 (0)