Skip to content

Commit

Permalink
TEMPORARY COMMIT - add themes to preferences page for adhoc
Browse files Browse the repository at this point in the history
  • Loading branch information
grgia committed Dec 5, 2023
1 parent 06b4e08 commit 2230d21
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/libs/Navigation/AppNavigator/ModalStackNavigators.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,7 @@ const SettingsModalStackNavigator = createModalStackNavigator({
[SCREENS.SETTINGS.PREFERENCES]: () => require('../../../pages/settings/Preferences/PreferencesPage').default,
Settings_Preferences_PriorityMode: () => require('../../../pages/settings/Preferences/PriorityModePage').default,
Settings_Preferences_Language: () => require('../../../pages/settings/Preferences/LanguagePage').default,
// Will be uncommented as part of https://github.com/Expensify/App/issues/21670
// Settings_Preferences_Theme: () => require('../../../pages/settings/Preferences/ThemePage').default,
Settings_Preferences_Theme: () => require('../../../pages/settings/Preferences/ThemePage').default,
Settings_Close: () => require('../../../pages/settings/Security/CloseAccountPage').default,
[SCREENS.SETTINGS.SECURITY]: () => require('../../../pages/settings/Security/SecuritySettingsPage').default,
Settings_About: () => require('../../../pages/settings/AboutPage/AboutPage').default,
Expand Down
13 changes: 13 additions & 0 deletions src/pages/settings/Preferences/PreferencesPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,15 @@ const propTypes = {
/** Whether or not the user is subscribed to news updates */
isSubscribedToNewsletter: PropTypes.bool,
}),

/** The app's color theme */
preferredTheme: PropTypes.string,
};

const defaultProps = {
priorityMode: CONST.PRIORITY_MODE.DEFAULT,
user: {},
preferredTheme: CONST.DEFAULT_THEME,
};

function PreferencesPage(props) {
Expand Down Expand Up @@ -80,6 +84,12 @@ function PreferencesPage(props) {
description={translate('languagePage.language')}
onPress={() => Navigation.navigate(ROUTES.SETTINGS_LANGUAGE)}
/>
<MenuItemWithTopDescription
shouldShowRightIcon
title={translate(`themePage.themes.${props.preferredTheme || CONST.THEME.DEFAULT}.label`)}
description={translate('themePage.theme')}
onPress={() => Navigation.navigate(ROUTES.SETTINGS_THEME)}
/>
{/* Enable additional test features in non-production environments */}
{!isProduction && (
<View style={[styles.ml5, styles.mr8, styles.mt6]}>
Expand All @@ -102,4 +112,7 @@ export default withOnyx({
user: {
key: ONYXKEYS.USER,
},
preferredTheme: {
key: ONYXKEYS.PREFERRED_THEME,
},
})(PreferencesPage);

0 comments on commit 2230d21

Please sign in to comment.