Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1412,6 +1412,10 @@ const DYNAMIC_ROUTES = {
path: 'keyboard-shortcuts',
entryScreens: ['*'],
},
APP_DOWNLOAD_LINKS: {
path: 'app-download-links',
entryScreens: ['*'],
},
SETTINGS_TAG_APPROVER: {
path: 'tag-approver',
entryScreens: [SCREENS.SETTINGS_TAGS.DYNAMIC_SETTINGS_TAG_SETTINGS],
Expand Down Expand Up @@ -2319,7 +2323,6 @@ const ROUTES = {
getRoute: (login: string, role: string) => `settings/security/delegate/${encodeURIComponent(login)}/role/${role}/confirm/validate-code` as const,
},
SETTINGS_ABOUT: 'settings/about',
SETTINGS_APP_DOWNLOAD_LINKS: 'settings/about/app-download-links',
SETTINGS_WALLET: 'settings/wallet',
SETTINGS_WALLET_DOMAIN_CARD: {
route: 'settings/wallet/card/:cardID?',
Expand Down
2 changes: 1 addition & 1 deletion src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ const SCREENS = {
COPILOT: 'Settings_Copilot',
ABOUT: 'Settings_About',
SAVE_THE_WORLD: 'Settings_TeachersUnite',
APP_DOWNLOAD_LINKS: 'Settings_App_Download_Links',
ADD_DEBIT_CARD: 'Settings_Add_Debit_Card',
ADD_BANK_ACCOUNT: 'Settings_Add_Bank_Account',
ADD_US_BANK_ACCOUNT: 'Settings_Add_US_Bank_Account',
Expand All @@ -97,6 +96,7 @@ const SCREENS = {
DYNAMIC_EXIT_SURVEY_CONFIRM: 'Dynamic_ExitSurvey_Confirm',
DYNAMIC_EXIT_SURVEY_REASON: 'Dynamic_ExitSurvey_Reason',
DYNAMIC_KEYBOARD_SHORTCUTS: 'Dynamic_Keyboard_Shortcuts',
DYNAMIC_APP_DOWNLOAD_LINKS: 'Dynamic_App_Download_Links',
DYNAMIC_SAGE_INTACCT_EXPORT: 'Dynamic_Sage_Intacct_Export',

PROFILE: {
Expand Down
4 changes: 2 additions & 2 deletions src/components/ReceiptAlternativeMethods.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import useThemeStyles from '@hooks/useThemeStyles';

import CONST from '@src/CONST';
import {addLeadingForwardSlash} from '@src/libs/Url';
import ROUTES, {DYNAMIC_ROUTES} from '@src/ROUTES';
import {DYNAMIC_ROUTES} from '@src/ROUTES';

import type {LayoutChangeEvent} from 'react-native';

Expand All @@ -34,7 +34,7 @@ function ReceiptAlternativeMethods({onLayout}: ReceiptAlternativeMethodsProps) {
const {hasPhoneNumberLogin, isPhoneNumberLoaded} = useHasPhoneNumberLogin();
const buildDynamicRoute = useScreenBoundDynamicRoute();

const downloadAppHref = `${environmentURL}${addLeadingForwardSlash(ROUTES.SETTINGS_APP_DOWNLOAD_LINKS)}`;
const downloadAppHref = `${environmentURL}${addLeadingForwardSlash(buildDynamicRoute(DYNAMIC_ROUTES.APP_DOWNLOAD_LINKS.path))}`;
const contactMethodsHref = `${environmentURL}${addLeadingForwardSlash(buildDynamicRoute(DYNAMIC_ROUTES.CONTACT_METHODS.path))}`;

if (!isLastMobileAppLoginLoaded || !isPhoneNumberLoaded) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,6 @@ const SettingsModalStackNavigator = createModalStackNavigator<SettingsNavigatorP
[SCREENS.SETTINGS.PREFERENCES.PAYMENT_CURRENCY]: () => require<ReactComponentModule>('../../../../pages/settings/Preferences/PaymentCurrencyPage').default,
[SCREENS.SETTINGS.DEVICE_MANAGEMENT]: () => require<ReactComponentModule>('../../../../pages/settings/Security/DeviceManagementPage').default,
[SCREENS.SETTINGS.CLOSE]: () => require<ReactComponentModule>('../../../../pages/settings/Security/CloseAccountPage').default,
[SCREENS.SETTINGS.APP_DOWNLOAD_LINKS]: () => require<ReactComponentModule>('../../../../pages/settings/AppDownloadLinks').default,
[SCREENS.SETTINGS.WALLET.CARDS_DIGITAL_DETAILS_UPDATE_ADDRESS]: () => require<ReactComponentModule>('../../../../pages/settings/Profile/PersonalDetails/PersonalAddressPage').default,
[SCREENS.SETTINGS.WALLET.DOMAIN_CARD]: () => require<ReactComponentModule>('../../../../pages/settings/Wallet/ExpensifyCardPage/index').default,
[SCREENS.SETTINGS.WALLET.EXPENSIFY_CARD_SPEND_RULES]: () => require<ReactComponentModule>('../../../../pages/settings/Wallet/WalletExpensifyCardSpendRulesPage').default,
Expand Down Expand Up @@ -730,6 +729,7 @@ const SettingsModalStackNavigator = createModalStackNavigator<SettingsNavigatorP
[SCREENS.SETTINGS.REPORT_CARD_LOST_OR_DAMAGED_CONFIRM_VALIDATE_CODE]: () =>
require<ReactComponentModule>('../../../../pages/settings/Wallet/ReportCardLostConfirmValidateCodePage').default,
[SCREENS.SETTINGS.DYNAMIC_KEYBOARD_SHORTCUTS]: () => require<ReactComponentModule>('../../../../pages/settings/DynamicKeyboardShortcutsPage').default,
[SCREENS.SETTINGS.DYNAMIC_APP_DOWNLOAD_LINKS]: () => require<ReactComponentModule>('../../../../pages/settings/DynamicAppDownloadLinksPage').default,
[SCREENS.SETTINGS.DYNAMIC_EXIT_SURVEY_REASON]: () => require<ReactComponentModule>('../../../../pages/settings/ExitSurvey/DynamicExitSurveyReasonPage').default,
[SCREENS.SETTINGS.DYNAMIC_EXIT_SURVEY_CONFIRM]: () => require<ReactComponentModule>('../../../../pages/settings/ExitSurvey/DynamicExitSurveyConfirmPage').default,
[SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_ONLINE_SETUP]: () => require<ReactComponentModule>('../../../../pages/workspace/accounting/qbo/QuickbooksOnlineSetupPage').default,
Expand Down
18 changes: 11 additions & 7 deletions src/libs/Navigation/helpers/getAdaptedStateFromPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ import TAB_SCREENS from '@libs/Navigation/AppNavigator/Navigators/TAB_SCREENS';
import {
RHP_TO_DOMAIN,
RHP_TO_HOME,
RHP_TO_HOME_DEEPLINK,
RHP_TO_SEARCH,
RHP_TO_SEARCH_DEEPLINK,
RHP_TO_SETTINGS,
RHP_TO_SETTINGS_DEEPLINK,
RHP_TO_SIDEBAR,
RHP_TO_WORKSPACE,
RHP_TO_WORKSPACES_LIST,
Expand Down Expand Up @@ -83,7 +85,7 @@ function isRouteWithReportID(route: NavigationRoute): route is Route<string, {re
/**
* @param route - The (focused) route to find a full screen route for.
* @param isDeeplink - Whether the state is being built from a path (deeplink / browser refresh / cold
* load) as opposed to in-app navigation. When true, deeplink-only relations (e.g. RHP_TO_SEARCH_DEEPLINK)
* load) as opposed to in-app navigation. When true, deeplink-only relations (the `*_DEEPLINK` variants)
* are also considered so an RHP can get a sensible default fullscreen underneath it. In-app callers
* (linkTo, swapBackgroundTabForRHPTarget) leave this false so the same RHP can open over any fullscreen
* without changing the page currently underneath.
Expand Down Expand Up @@ -120,8 +122,8 @@ function getMatchingFullScreenRoute(route: NavigationRoute, isDeeplink = false)
return getMatchingFullScreenRoute(focusedStateForBackToRoute, isDeeplink);
}

// Deeplink-only relations provide a default search screen underneath the RHP when the state is
// built from a path. They are ignored for in-app navigation so the RHP can open over any fullscreen.
// Deeplink-only relations provide a default fullscreen underneath the RHP when the state is built from
// a path. They are ignored for in-app navigation so the RHP can open over any fullscreen.
const matchingSearchScreen = RHP_TO_SEARCH[route.name];
const matchingDeeplinkSearchScreen = isDeeplink ? RHP_TO_SEARCH_DEEPLINK[route.name] : undefined;
const resolvedSearchScreen = matchingSearchScreen ?? matchingDeeplinkSearchScreen;
Expand Down Expand Up @@ -152,7 +154,8 @@ function getMatchingFullScreenRoute(route: NavigationRoute, isDeeplink = false)
return getTabNavigatorState({name: NAVIGATORS.SEARCH_FULLSCREEN_NAVIGATOR, state: searchState});
}

if (RHP_TO_HOME[route.name]) {
const matchingHomeScreen = RHP_TO_HOME[route.name] ?? (isDeeplink ? RHP_TO_HOME_DEEPLINK[route.name] : undefined);
if (matchingHomeScreen) {
return {
...getTabNavigatorState({name: SCREENS.HOME}),
path: normalizePath(ROUTES.HOME),
Expand Down Expand Up @@ -193,13 +196,14 @@ function getMatchingFullScreenRoute(route: NavigationRoute, isDeeplink = false)
});
}

if (RHP_TO_SETTINGS[route.name]) {
const paramsFromRoute = getParamsFromRoute(RHP_TO_SETTINGS[route.name]);
const matchingSettingsScreen = RHP_TO_SETTINGS[route.name] ?? (isDeeplink ? RHP_TO_SETTINGS_DEEPLINK[route.name] : undefined);
if (matchingSettingsScreen) {
const paramsFromRoute = getParamsFromRoute(matchingSettingsScreen);

const settingsState = getInitialSplitNavigatorState(
{name: SCREENS.SETTINGS.ROOT},
{
name: RHP_TO_SETTINGS[route.name],
name: matchingSettingsScreen,
params: paramsFromRoute.length > 0 ? pick(route.params, paramsFromRoute) : undefined,
},
);
Expand Down
5 changes: 2 additions & 3 deletions src/libs/Navigation/linkingConfig/RELATIONS/HOME_TO_RHP.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import SCREENS from '@src/SCREENS';

const HOME_TO_RHP: Record<typeof SCREENS.HOME, string[]> = {
// Transaction/report RHP screens opened from the Recently added slot keep Home underneath on refresh/deep-link.
// The Enter signer info flow is opened from the Time Sensitive section, so it keeps Home underneath too.
[SCREENS.HOME]: [SCREENS.RIGHT_MODAL.SEARCH_REPORT, SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT, SCREENS.RIGHT_MODAL.EXPENSE_REPORT, SCREENS.REIMBURSEMENT_ACCOUNT_ENTER_SIGNER_INFO],
// Transaction/report RHP screens opened from the Recently added slot keep Home underneath.
[SCREENS.HOME]: [SCREENS.RIGHT_MODAL.SEARCH_REPORT, SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT, SCREENS.RIGHT_MODAL.EXPENSE_REPORT],
};

export default HOME_TO_RHP;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import SCREENS from '@src/SCREENS';

/**
* Deeplink-only variant of HOME_TO_RHP. Consulted ONLY when navigation state is built from a path
* (deeplink / browser refresh / cold load) via the `isDeeplink` flag in getMatchingFullScreenRoute,
* so these RHP screens still get Home underneath on a fresh load without forcing it for in-app navigation.
*/
const HOME_TO_RHP_DEEPLINK: Record<typeof SCREENS.HOME, string[]> = {
// Also opened from a chat message, so it must not force Home underneath on click.
[SCREENS.HOME]: [SCREENS.REIMBURSEMENT_ACCOUNT_ENTER_SIGNER_INFO],
};

export default HOME_TO_RHP_DEEPLINK;
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const SETTINGS_TO_RHP: Partial<Record<keyof SettingsSplitNavigatorParamList, str
SCREENS.SETTINGS.WALLET.DOMAIN_CARD,
SCREENS.SETTINGS.WALLET.EXPENSIFY_CARD_SPEND_RULES,
SCREENS.SETTINGS.WALLET.DOMAIN_CARD_CONFIRM_VALIDATE_CODE,
SCREENS.SETTINGS.WALLET.PERSONAL_CARD_DETAILS,
SCREENS.SETTINGS.WALLET.PERSONAL_CARD_EDIT_NAME,
SCREENS.SETTINGS.WALLET.PERSONAL_CARD_EDIT_TRANSACTION_START_DATE,
SCREENS.SETTINGS.WALLET.TRANSFER_BALANCE,
Expand Down Expand Up @@ -59,7 +58,6 @@ const SETTINGS_TO_RHP: Partial<Record<keyof SettingsSplitNavigatorParamList, str
SCREENS.SETTINGS.REPORT_CARD_LOST_OR_DAMAGED,
SCREENS.SETTINGS.REPORT_CARD_LOST_OR_DAMAGED_CONFIRM_VALIDATE_CODE,
SCREENS.SETTINGS.UPDATE_PERSONAL_BANK_ACCOUNT,
SCREENS.SETTINGS.ADD_US_BANK_ACCOUNT,
SCREENS.SETTINGS.ADD_US_BANK_ACCOUNT_ENTRY_POINT,
SCREENS.SETTINGS.WALLET.PERSONAL_CARD_ADD_NEW,
SCREENS.SETTINGS.WALLET.PERSONAL_CARD_FIX_CONNECTION,
Expand Down Expand Up @@ -124,11 +122,9 @@ const SETTINGS_TO_RHP: Partial<Record<keyof SettingsSplitNavigatorParamList, str
SCREENS.SETTINGS.DELEGATE.DELEGATE_CONFIRM,
SCREENS.SETTINGS.DELEGATE.DELEGATE_CONFIRM_VALIDATE_CODE,
],
[SCREENS.SETTINGS.ABOUT]: [SCREENS.SETTINGS.APP_DOWNLOAD_LINKS],
[SCREENS.SETTINGS.SAVE_THE_WORLD]: [SCREENS.SAVE_THE_WORLD.ADD_PAYMENT_CARD, SCREENS.I_KNOW_A_TEACHER, SCREENS.I_AM_A_TEACHER],
[SCREENS.SETTINGS.TROUBLESHOOT]: [SCREENS.SETTINGS.DYNAMIC_EXIT_SURVEY_REASON, SCREENS.SETTINGS.DYNAMIC_EXIT_SURVEY_CONFIRM, SCREENS.RIGHT_MODAL.BETA_OVERRIDES],
[SCREENS.SETTINGS.SUBSCRIPTION.ROOT]: [
SCREENS.SETTINGS.SUBSCRIPTION.ADD_PAYMENT_CARD,
SCREENS.SETTINGS.SUBSCRIPTION.SIZE,
SCREENS.SETTINGS.SUBSCRIPTION.EXPENSIFY_CODE,
SCREENS.SETTINGS.SUBSCRIPTION.DISABLE_AUTO_RENEW_SURVEY,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type {SettingsSplitNavigatorParamList} from '@navigation/types';

import SCREENS from '@src/SCREENS';

/**
* Deeplink-only variant of SETTINGS_TO_RHP. Consulted ONLY when navigation state is built from a path
* (deeplink / browser refresh / cold load) via the `isDeeplink` flag in getMatchingFullScreenRoute,
* so these RHP screens still get a settings page underneath on a fresh load without forcing it for in-app navigation.
*/
const SETTINGS_TO_RHP_DEEPLINK: Partial<Record<keyof SettingsSplitNavigatorParamList, string[]>> = {
// These RHP screens are also opened from a chat or from Home, so they must not force the settings page underneath on click.
[SCREENS.SETTINGS.WALLET.ROOT]: [SCREENS.SETTINGS.WALLET.PERSONAL_CARD_DETAILS, SCREENS.SETTINGS.ADD_US_BANK_ACCOUNT],
[SCREENS.SETTINGS.SUBSCRIPTION.ROOT]: [SCREENS.SETTINGS.SUBSCRIPTION.ADD_PAYMENT_CARD],
};

export default SETTINGS_TO_RHP_DEEPLINK;
19 changes: 18 additions & 1 deletion src/libs/Navigation/linkingConfig/RELATIONS/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import DOMAIN_TO_RHP from './DOMAIN_TO_RHP';
import HOME_TO_RHP from './HOME_TO_RHP';
import HOME_TO_RHP_DEEPLINK from './HOME_TO_RHP_DEEPLINK';
import SEARCH_TO_RHP from './SEARCH_TO_RHP';
import SEARCH_TO_RHP_DEEPLINK from './SEARCH_TO_RHP_DEEPLINK';
import SETTINGS_TO_RHP from './SETTINGS_TO_RHP';
import SETTINGS_TO_RHP_DEEPLINK from './SETTINGS_TO_RHP_DEEPLINK';
import SIDEBAR_TO_RHP from './SIDEBAR_TO_RHP';
import SIDEBAR_TO_SPLIT from './SIDEBAR_TO_SPLIT';
import WORKSPACE_TO_RHP from './WORKSPACE_TO_RHP';
Expand All @@ -29,6 +31,7 @@ function createInverseRelation<T extends string, K extends string>(relations: Pa
}

const RHP_TO_SETTINGS = createInverseRelation(SETTINGS_TO_RHP);
const RHP_TO_SETTINGS_DEEPLINK = createInverseRelation(SETTINGS_TO_RHP_DEEPLINK);
const RHP_TO_WORKSPACE = createInverseRelation(WORKSPACE_TO_RHP);
const RHP_TO_SIDEBAR = createInverseRelation(SIDEBAR_TO_RHP);
const SPLIT_TO_SIDEBAR = createInverseRelation(SIDEBAR_TO_SPLIT);
Expand All @@ -39,5 +42,19 @@ const RHP_TO_SEARCH = createInverseRelation(SEARCH_TO_RHP);
const RHP_TO_SEARCH_DEEPLINK = createInverseRelation(SEARCH_TO_RHP_DEEPLINK);
const RHP_TO_DOMAIN = createInverseRelation(DOMAIN_TO_RHP);
const RHP_TO_HOME = createInverseRelation(HOME_TO_RHP);
const RHP_TO_HOME_DEEPLINK = createInverseRelation(HOME_TO_RHP_DEEPLINK);

export {RHP_TO_SETTINGS, RHP_TO_WORKSPACE, RHP_TO_SIDEBAR, RHP_TO_SEARCH, RHP_TO_SEARCH_DEEPLINK, SIDEBAR_TO_SPLIT, SPLIT_TO_SIDEBAR, RHP_TO_WORKSPACES_LIST, RHP_TO_DOMAIN, RHP_TO_HOME};
export {
RHP_TO_SETTINGS,
RHP_TO_SETTINGS_DEEPLINK,
RHP_TO_WORKSPACE,
RHP_TO_SIDEBAR,
RHP_TO_SEARCH,
RHP_TO_SEARCH_DEEPLINK,
SIDEBAR_TO_SPLIT,
SPLIT_TO_SIDEBAR,
RHP_TO_WORKSPACES_LIST,
RHP_TO_DOMAIN,
RHP_TO_HOME,
RHP_TO_HOME_DEEPLINK,
};
5 changes: 1 addition & 4 deletions src/libs/Navigation/linkingConfig/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,6 @@ const config: LinkingOptions<RootNavigatorParamList>['config'] = {
path: ROUTES.SETTINGS_TIMEZONE_SELECT,
exact: true,
},
[SCREENS.SETTINGS.APP_DOWNLOAD_LINKS]: {
path: ROUTES.SETTINGS_APP_DOWNLOAD_LINKS,
exact: true,
},
[SCREENS.SETTINGS.DYNAMIC_VERIFY_ACCOUNT]: DYNAMIC_ROUTES.VERIFY_ACCOUNT.path,
[SCREENS.SETTINGS.DYNAMIC_ADD_BANK_ACCOUNT_VERIFY_ACCOUNT]: DYNAMIC_ROUTES.ADD_BANK_ACCOUNT_VERIFY_ACCOUNT.path,
[SCREENS.SETTINGS.SUBSCRIPTION.DYNAMIC_PAYMENT_CARD_CURRENCY_SELECTOR]: DYNAMIC_ROUTES.PAYMENT_CARD_CURRENCY_SELECTOR.path,
Expand Down Expand Up @@ -1213,6 +1209,7 @@ const config: LinkingOptions<RootNavigatorParamList>['config'] = {
[SCREENS.DYNAMIC_REIMBURSEMENT_ACCOUNT_VERIFY_ACCOUNT]: DYNAMIC_ROUTES.BANK_ACCOUNT_VERIFY_ACCOUNT.path,
[SCREENS.REIMBURSEMENT_ACCOUNT_ENTER_SIGNER_INFO]: ROUTES.BANK_ACCOUNT_ENTER_SIGNER_INFO.route,
[SCREENS.SETTINGS.DYNAMIC_KEYBOARD_SHORTCUTS]: DYNAMIC_ROUTES.KEYBOARD_SHORTCUTS.path,
[SCREENS.SETTINGS.DYNAMIC_APP_DOWNLOAD_LINKS]: DYNAMIC_ROUTES.APP_DOWNLOAD_LINKS.path,
[SCREENS.WORKSPACE.NAME]: ROUTES.WORKSPACE_OVERVIEW_NAME.route,
[SCREENS.SETTINGS.SHARE_CODE]: {
path: ROUTES.SETTINGS_SHARE_CODE,
Expand Down
1 change: 1 addition & 0 deletions src/libs/Navigation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1446,6 +1446,7 @@ type SettingsNavigatorParamList = {
isFromDomainCardDetail?: string;
};
[SCREENS.SETTINGS.DYNAMIC_KEYBOARD_SHORTCUTS]: undefined;
[SCREENS.SETTINGS.DYNAMIC_APP_DOWNLOAD_LINKS]: undefined;
[SCREENS.WORKSPACE.TAX_CREATE]: {
policyID: string;
};
Expand Down
4 changes: 2 additions & 2 deletions src/pages/settings/AboutPage/AboutPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {navigateToConciergeChat} from '@userActions/Report';
import CONST from '@src/CONST';
import type {TranslationPaths} from '@src/languages/types';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES, {DYNAMIC_ROUTES} from '@src/ROUTES';
import {DYNAMIC_ROUTES} from '@src/ROUTES';
import type IconAsset from '@src/types/utils/IconAsset';
import type WithSentryLabel from '@src/types/utils/SentryLabel';

Expand Down Expand Up @@ -84,7 +84,7 @@ function AboutPage() {
translationKey: 'initialSettingsPage.aboutPage.appDownloadLinks',
icon: icons.Link,
sentryLabel: CONST.SENTRY_LABEL.SETTINGS_ABOUT.APP_DOWNLOAD_LINKS,
action: waitForNavigate(() => Navigation.navigate(ROUTES.SETTINGS_APP_DOWNLOAD_LINKS)),
action: waitForNavigate(() => Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.APP_DOWNLOAD_LINKS.path))),
},
{
translationKey: 'initialSettingsPage.aboutPage.viewKeyboardShortcuts',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import QRShare from '@components/QRShare';
import ScreenWrapper from '@components/ScreenWrapper';
import ScrollView from '@components/ScrollView';

import useDynamicBackPath from '@hooks/useDynamicBackPath';
import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
Expand All @@ -18,6 +19,7 @@ import {showContextMenu} from '@pages/inbox/report/ContextMenu/ReportActionConte

import CONST from '@src/CONST';
import type {TranslationPaths} from '@src/languages/types';
import {DYNAMIC_ROUTES} from '@src/ROUTES';

import type {View} from 'react-native';

Expand All @@ -29,11 +31,12 @@ type DownloadMenuItem = MenuItemProps & {
link: string;
};

function AppDownloadLinksPage() {
function DynamicAppDownloadLinksPage() {
const icons = useMemoizedLazyExpensifyIcons(['Android', 'Apple', 'Monitor', 'NewWindow']);
const styles = useThemeStyles();
const {translate} = useLocalize();
const popoverAnchor = useRef<View>(null);
const backPath = useDynamicBackPath(DYNAMIC_ROUTES.APP_DOWNLOAD_LINKS.path);

const menuItems: DownloadMenuItem[] = [
{
Expand All @@ -60,7 +63,7 @@ function AppDownloadLinksPage() {
<ScreenWrapper testID="AppDownloadLinksPage">
<HeaderWithBackButton
title={translate('initialSettingsPage.aboutPage.appDownloadLinks')}
onBackButtonPress={() => Navigation.goBack()}
onBackButtonPress={() => Navigation.goBack(backPath)}
/>

<QRShare
Expand Down Expand Up @@ -101,4 +104,4 @@ function AppDownloadLinksPage() {
);
}

export default AppDownloadLinksPage;
export default DynamicAppDownloadLinksPage;
Loading
Loading