diff --git a/src/pages/ReimbursementAccount/ContinueBankAccountSetup.js b/src/pages/ReimbursementAccount/ContinueBankAccountSetup.js index 4eca196d328a..1d0c3032d5b9 100644 --- a/src/pages/ReimbursementAccount/ContinueBankAccountSetup.js +++ b/src/pages/ReimbursementAccount/ContinueBankAccountSetup.js @@ -7,16 +7,13 @@ import * as Expensicons from '../../components/Icon/Expensicons'; import * as Illustrations from '../../components/Icon/Illustrations'; import withLocalize, {withLocalizePropTypes} from '../../components/withLocalize'; import Button from '../../components/Button'; -import compose from '../../libs/compose'; import CONST from '../../CONST'; -import FullPageNotFoundView from '../../components/BlockingViews/FullPageNotFoundView'; import HeaderWithBackButton from '../../components/HeaderWithBackButton'; import MenuItem from '../../components/MenuItem'; import styles from '../../styles/styles'; import ScreenWrapper from '../../components/ScreenWrapper'; import Section from '../../components/Section'; import Text from '../../components/Text'; -import withPolicy from '../workspace/withPolicy'; import * as ReimbursementAccountProps from './reimbursementAccountPropTypes'; import WorkspaceResetBankAccountModal from '../workspace/WorkspaceResetBankAccountModal'; import * as BankAccounts from '../../libs/actions/BankAccounts'; @@ -29,11 +26,6 @@ const propTypes = { /** Callback to continue to the next step of the setup */ continue: PropTypes.func.isRequired, - /** Policy values needed in the component */ - policy: PropTypes.shape({ - name: PropTypes.string, - }).isRequired, - /* The workspace name */ policyName: PropTypes.string, @@ -47,48 +39,46 @@ function ContinueBankAccountSetup(props) { const pendingAction = lodashGet(props.reimbursementAccount, 'pendingAction', null); return ( - - - -
+ +
+ - - {props.translate('workspace.bankAccount.youreAlmostDone')} -
-
- + {props.translate('workspace.bankAccount.youreAlmostDone')} +
+
{props.reimbursementAccount.shouldShowResetModal && }
@@ -99,4 +89,4 @@ ContinueBankAccountSetup.propTypes = propTypes; ContinueBankAccountSetup.defaultProps = defaultProps; ContinueBankAccountSetup.displayName = 'ContinueBankAccountSetup'; -export default compose(withPolicy, withLocalize)(ContinueBankAccountSetup); +export default withLocalize(ContinueBankAccountSetup); diff --git a/src/pages/ReimbursementAccount/ReimbursementAccountPage.js b/src/pages/ReimbursementAccount/ReimbursementAccountPage.js index d12231e85370..7b4681100f6b 100644 --- a/src/pages/ReimbursementAccount/ReimbursementAccountPage.js +++ b/src/pages/ReimbursementAccount/ReimbursementAccountPage.js @@ -31,6 +31,7 @@ import HeaderWithBackButton from '../../components/HeaderWithBackButton'; import * as ReimbursementAccountProps from './reimbursementAccountPropTypes'; import reimbursementAccountDraftPropTypes from './ReimbursementAccountDraftPropTypes'; import withPolicy from '../workspace/withPolicy'; +import FullPageNotFoundView from '../../components/BlockingViews/FullPageNotFoundView'; const propTypes = { /** Plaid SDK token to use to initialize the widget */ @@ -329,6 +330,18 @@ class ReimbursementAccountPage extends React.Component { const currentStep = achData.currentStep || CONST.BANK_ACCOUNT.STEP.BANK_ACCOUNT; const policyName = lodashGet(this.props.policy, 'name'); + if (_.isEmpty(this.props.policy)) { + return ( + + Navigation.navigate(ROUTES.SETTINGS_WORKSPACES)} + shouldShowLink + /> + + ); + } + const isLoading = this.props.isLoadingReportData || this.props.account.isLoading || this.props.reimbursementAccount.isLoading; // Prevent the full-page blocking offline view from being displayed for these steps if the device goes offline.