diff --git a/src/ROUTES.ts b/src/ROUTES.ts index c532970824b0..e9f797e23c26 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -917,7 +917,7 @@ const ROUTES = { }, WORKSPACE_EXPENSIFY_CARD_ISSUE_NEW: { route: 'settings/workspaces/:policyID/expensify-card/issue-new', - getRoute: (policyID: string) => `settings/workspaces/${policyID}/expensify-card/issue-new` as const, + getRoute: (policyID: string, backTo?: string) => getUrlWithBackToParam(`settings/workspaces/${policyID}/expensify-card/issue-new`, backTo), }, WORKSPACE_EXPENSIFY_CARD_BANK_ACCOUNT: { route: 'settings/workspaces/:policyID/expensify-card/choose-bank-account', diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index 28544da90423..2c41c7809c78 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -676,6 +676,7 @@ type SettingsNavigatorParamList = { }; [SCREENS.WORKSPACE.EXPENSIFY_CARD_ISSUE_NEW]: { policyID: string; + backTo?: Routes; }; [SCREENS.WORKSPACE.EXPENSIFY_CARD_BANK_ACCOUNT]: { policyID: string; diff --git a/src/pages/workspace/expensifyCard/WorkspaceExpensifyCardListPage.tsx b/src/pages/workspace/expensifyCard/WorkspaceExpensifyCardListPage.tsx index c27d5a7168ba..bb25ca4e90a6 100644 --- a/src/pages/workspace/expensifyCard/WorkspaceExpensifyCardListPage.tsx +++ b/src/pages/workspace/expensifyCard/WorkspaceExpensifyCardListPage.tsx @@ -49,12 +49,17 @@ function WorkspaceExpensifyCardListPage({route, cardsList}: WorkspaceExpensifyCa const sortedCards = useMemo(() => CardUtils.sortCardsByCardholderName(cardsList, personalDetails), [cardsList, personalDetails]); + const issueCard = () => { + const activeRoute = Navigation.getActiveRoute(); + Navigation.navigate(ROUTES.WORKSPACE_EXPENSIFY_CARD_ISSUE_NEW.getRoute(policyID, activeRoute)); + }; + const getHeaderButtons = () => (