Skip to content

Commit

Permalink
Reconfigure to default for IDEAL NAV 2
Browse files Browse the repository at this point in the history
  • Loading branch information
aeioual committed Mar 17, 2024
1 parent a6e029c commit daa6d4d
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 24 deletions.
3 changes: 1 addition & 2 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ const ROUTES = {
SETTINGS_SECURITY: 'settings/security',
SETTINGS_CLOSE: 'settings/security/closeAccount',
SETTINGS_ABOUT: 'settings/about',
SETTINGS_SAVE_THE_WORLD: 'settings/teachersunite',
SETTINGS_APP_DOWNLOAD_LINKS: 'settings/about/app-download-links',
SETTINGS_WALLET: 'settings/wallet',
SETTINGS_WALLET_DOMAINCARD: {
Expand Down Expand Up @@ -657,4 +656,4 @@ type Route = RouteIsPlainString extends true ? never : AllRoutes;

type HybridAppRoute = (typeof HYBRID_APP_ROUTES)[keyof typeof HYBRID_APP_ROUTES];

export type {Route, HybridAppRoute, AllRoutes};
export type {Route, HybridAppRoute, AllRoutes};
3 changes: 1 addition & 2 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ const SCREENS = {
TROUBLESHOOT: 'Settings_Troubleshoot',
CONSOLE: 'Settings_Console',
SHARE_LOG: 'Share_Log',
SAVE_THE_WORLD: 'Settings_TeachersUnite',

PROFILE: {
ROOT: 'Settings_Profile',
Expand Down Expand Up @@ -295,4 +294,4 @@ type Screen = DeepValueOf<typeof SCREENS>;

export default SCREENS;
export {PROTECTED_SCREENS};
export type {Screen};
export type {Screen};
8 changes: 1 addition & 7 deletions src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,6 @@ const NewTeachersUniteNavigator = createModalStackNavigator<TeachersUniteNavigat

const WorkspaceSettingsModalStackNavigator = createModalStackNavigator(
{
[SCREENS.SETTINGS.PREFERENCES.ROOT]: () => require('../../../pages/settings/Preferences/PreferencesPage').default as React.ComponentType,
[SCREENS.SETTINGS.SECURITY]: () => require('../../../pages/settings/Security/SecuritySettingsPage').default as React.ComponentType,
[SCREENS.SETTINGS.PROFILE.ROOT]: () => require('../../../pages/settings/Profile/ProfilePage').default as React.ComponentType,
[SCREENS.SETTINGS.WALLET.ROOT]: () => require('../../../pages/settings/Wallet/WalletPage').default as React.ComponentType,
[SCREENS.SETTINGS.ABOUT]: () => require('../../../pages/settings/AboutPage/AboutPage').default as React.ComponentType,
[SCREENS.SETTINGS.SAVE_THE_WORLD]: () => require('../../../pages/TeachersUnite/SaveTheWorldPage').default as React.ComponentType,
[SCREENS.WORKSPACE.PROFILE]: () => require('../../../pages/workspace/WorkspaceProfilePage').default as React.ComponentType,
[SCREENS.WORKSPACE.CARD]: () => require('../../../pages/workspace/card/WorkspaceCardPage').default as React.ComponentType,
[SCREENS.WORKSPACE.WORKFLOWS]: () => require('../../../pages/workspace/workflows/WorkspaceWorkflowsPage').default as React.ComponentType,
Expand Down Expand Up @@ -360,4 +354,4 @@ export {
WalletStatementStackNavigator,
ProcessMoneyRequestHoldStackNavigator,
WorkspaceSettingsModalStackNavigator,
};
};
6 changes: 1 addition & 5 deletions src/libs/Navigation/linkingConfig/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -603,15 +603,11 @@ const config: LinkingOptions<RootStackParamList>['config'] = {
[SCREENS.WORKSPACE.DISTANCE_RATES]: {
path: ROUTES.WORKSPACE_DISTANCE_RATES.route,
},
[SCREENS.SETTINGS.SAVE_THE_WORLD]: {
path: ROUTES.SETTINGS_SAVE_THE_WORLD,
exact: true,
},
},
},
},
},
},
};

export default config;
export default config;
21 changes: 13 additions & 8 deletions src/pages/settings/InitialSettingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,9 @@ function InitialSettingsPage({session, userWallet, bankAccountList, fundList, wa
* Retuns a list of menu items data for general section
* @returns object with translationKey, style and items for the general section
*/
const generalMenuItemsData: Menu = useMemo(
() => ({
const generalMenuItemsData: Menu = useMemo(() => {
const signOutTranslationKey = Session.isSupportAuthToken() && Session.hasStashedSession() ? 'initialSettingsPage.restoreStashed' : 'initialSettingsPage.signOut';
const defaultMenu: Menu = {
sectionStyle: {
...styles.pt4,
},
Expand All @@ -247,14 +248,18 @@ function InitialSettingsPage({session, userWallet, bankAccountList, fundList, wa
routeName: ROUTES.SETTINGS_ABOUT,
},
{
translationKey: 'sidebarScreen.saveTheWorld',
icon: Expensicons.Heart,
routeName: ROUTES.SETTINGS_SAVE_THE_WORLD,
translationKey: signOutTranslationKey,
icon: Expensicons.Exit,
action: () => {
signOut(false);
},
},
],
}),
[styles.pt4],
);
};

return defaultMenu;
}, [styles.pt4, signOut]);


/**
* Retuns JSX.Element with menu items
Expand Down

0 comments on commit daa6d4d

Please sign in to comment.