Skip to content

Commit

Permalink
Lift-up handle onBackButtonPress in ReimbursementAccountPage
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangzinh committed Oct 1, 2023
1 parent 6c96f5d commit 4dbdfe2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions src/pages/ReimbursementAccount/EnableStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -37,16 +35,15 @@ 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,
};

const defaultProps = {
user: {},
policyName: '',
policyID: '',
};

function EnableStep(props) {
Expand All @@ -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}
/>
<ScrollView style={[styles.flex1]}>
<Section
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ReimbursementAccount/ReimbursementAccountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ class ReimbursementAccountPage extends React.Component {
<EnableStep
reimbursementAccount={this.props.reimbursementAccount}
policyName={policyName}
policyID={policyID}
onBackButtonPress={this.goBack}
/>
);
}
Expand Down

0 comments on commit 4dbdfe2

Please sign in to comment.