diff --git a/src/pages/workspace/reimburse/WorkspaceReimbursePage.js b/src/pages/workspace/reimburse/WorkspaceReimbursePage.js index 840dda1fcdab..2f0e8a9e3816 100644 --- a/src/pages/workspace/reimburse/WorkspaceReimbursePage.js +++ b/src/pages/workspace/reimburse/WorkspaceReimbursePage.js @@ -1,8 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize'; -import WorkspaceReimburseNoVBAView from './WorkspaceReimburseNoVBAView'; -import WorkspaceReimburseVBAView from './WorkspaceReimburseVBAView'; +import WorkspaceReimburseView from './WorkspaceReimburseView'; import WorkspacePageWithSections from '../WorkspacePageWithSections'; import CONST from '../../../CONST'; @@ -26,13 +25,7 @@ const WorkspaceReimbursePage = props => ( guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_REIMBURSE} > {(hasVBA, policyID) => ( - <> - {!hasVBA ? ( - - ) : ( - - )} - + )} ); diff --git a/src/pages/workspace/reimburse/WorkspaceReimburseVBAView.js b/src/pages/workspace/reimburse/WorkspaceReimburseVBAView.js deleted file mode 100644 index 919c340b4079..000000000000 --- a/src/pages/workspace/reimburse/WorkspaceReimburseVBAView.js +++ /dev/null @@ -1,70 +0,0 @@ -import React from 'react'; -import {View} from 'react-native'; -import PropTypes from 'prop-types'; -import Text from '../../../components/Text'; -import styles from '../../../styles/styles'; -import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize'; -import * as Expensicons from '../../../components/Icon/Expensicons'; -import * as Illustrations from '../../../components/Icon/Illustrations'; -import Section from '../../../components/Section'; -import CopyTextToClipboard from '../../../components/CopyTextToClipboard'; -import * as Link from '../../../libs/actions/Link'; - -const propTypes = { - /** The policy ID currently being configured */ - policyID: PropTypes.string.isRequired, - - ...withLocalizePropTypes, -}; - -const WorkspaceReimburseVBAView = props => ( - <> -
Link.openOldDotLink(`expenses?policyIDList=${props.policyID}&billableReimbursable=reimbursable&submitterEmail=%2B%2B`), - icon: Expensicons.Receipt, - shouldShowRightIcon: true, - iconRight: Expensicons.NewWindow, - }, - ]} - > - - - {props.translate('workspace.reimburse.captureNoVBACopyBeforeEmail')} - - {props.translate('workspace.reimburse.captureNoVBACopyAfterEmail')} - - -
- -
Link.openOldDotLink(`reports?policyID=${props.policyID}&from=all&type=expense&showStates=Archived&isAdvancedFilterMode=true`), - icon: Expensicons.Bank, - shouldShowRightIcon: true, - iconRight: Expensicons.NewWindow, - }, - ]} - > - - {props.translate('workspace.reimburse.fastReimbursementsVBACopy')} - -
- -); - -WorkspaceReimburseVBAView.propTypes = propTypes; -WorkspaceReimburseVBAView.displayName = 'WorkspaceReimburseVBAView'; - -export default withLocalize(WorkspaceReimburseVBAView); diff --git a/src/pages/workspace/reimburse/WorkspaceReimburseNoVBAView.js b/src/pages/workspace/reimburse/WorkspaceReimburseView.js similarity index 76% rename from src/pages/workspace/reimburse/WorkspaceReimburseNoVBAView.js rename to src/pages/workspace/reimburse/WorkspaceReimburseView.js index f36f63b87698..927401c46522 100644 --- a/src/pages/workspace/reimburse/WorkspaceReimburseNoVBAView.js +++ b/src/pages/workspace/reimburse/WorkspaceReimburseView.js @@ -27,6 +27,9 @@ const propTypes = { /** The policy ID currently being configured */ policyID: PropTypes.string.isRequired, + /** Does the user has a VBA into its account? */ + hasVBA: PropTypes.bool.isRequired, + /** Policy values needed in the component */ policy: PropTypes.shape({ customUnit: PropTypes.shape({ @@ -45,7 +48,7 @@ const propTypes = { ...withLocalizePropTypes, }; -class WorkspaceReimburseNoVBAView extends React.Component { +class WorkspaceReimburseView extends React.Component { constructor(props) { super(props); this.state = { @@ -188,31 +191,52 @@ class WorkspaceReimburseNoVBAView extends React.Component { -
- - {this.props.translate('workspace.reimburse.unlockNoVBACopy')} - -
+ {!this.props.hasVBA && ( +
+ + {this.props.translate('workspace.reimburse.unlockNoVBACopy')} + +
+ )} + {Boolean(this.props.hasVBA) && ( +
Link.openOldDotLink(`reports?policyID=${this.props.policyID}&from=all&type=expense&showStates=Archived&isAdvancedFilterMode=true`), + icon: Expensicons.Bank, + shouldShowRightIcon: true, + iconRight: Expensicons.NewWindow, + }, + ]} + > + + {this.props.translate('workspace.reimburse.fastReimbursementsVBACopy')} + +
+ )} ); } } -WorkspaceReimburseNoVBAView.propTypes = propTypes; -WorkspaceReimburseNoVBAView.displayName = 'WorkspaceReimburseNoVBAView'; +WorkspaceReimburseView.propTypes = propTypes; +WorkspaceReimburseView.displayName = 'WorkspaceReimburseView'; export default compose( withFullPolicy, @@ -222,4 +246,4 @@ export default compose( key: ({policyID}) => `${ONYXKEYS.COLLECTION.POLICY}${policyID}`, }, }), -)(WorkspaceReimburseNoVBAView); +)(WorkspaceReimburseView);