From 4dbdfe20241ff33f469c4e84ec8c90cb00908a59 Mon Sep 17 00:00:00 2001 From: VH Date: Mon, 2 Oct 2023 05:58:31 +0700 Subject: [PATCH] Lift-up handle onBackButtonPress in ReimbursementAccountPage --- src/pages/ReimbursementAccount/EnableStep.js | 9 +++------ .../ReimbursementAccount/ReimbursementAccountPage.js | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/pages/ReimbursementAccount/EnableStep.js b/src/pages/ReimbursementAccount/EnableStep.js index 91b8d1090176..6612a0b6ad2f 100644 --- a/src/pages/ReimbursementAccount/EnableStep.js +++ b/src/pages/ReimbursementAccount/EnableStep.js @@ -24,8 +24,6 @@ import * as Link from '../../libs/actions/Link'; import ScreenWrapper from '../../components/ScreenWrapper'; import * as BankAccounts from '../../libs/actions/ReimbursementAccount'; import WorkspaceResetBankAccountModal from '../workspace/WorkspaceResetBankAccountModal'; -import Navigation from '../../libs/Navigation/Navigation'; -import ROUTES from '../../ROUTES'; const propTypes = { /** Bank account currently in setup */ @@ -37,8 +35,8 @@ const propTypes = { /* The workspace name */ policyName: PropTypes.string, - /* The workspace policyID */ - policyID: PropTypes.string, + /** Method to trigger when pressing back button of the header */ + onBackButtonPress: PropTypes.func.isRequired, ...withLocalizePropTypes, }; @@ -46,7 +44,6 @@ const propTypes = { const defaultProps = { user: {}, policyName: '', - policyID: '', }; function EnableStep(props) { @@ -69,7 +66,7 @@ function EnableStep(props) { subtitle={props.policyName} shouldShowGetAssistanceButton guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_BANK_ACCOUNT} - onBackButtonPress={() => Navigation.navigate(ROUTES.WORKSPACE_REIMBURSE.getRoute(props.policyID))} + onBackButtonPress={props.onBackButtonPress} />
); }