-
Notifications
You must be signed in to change notification settings - Fork 2.9k
/
WorkspaceTravelPage.js
45 lines (40 loc) · 1.48 KB
/
WorkspaceTravelPage.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import React from 'react';
import PropTypes from 'prop-types';
import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize';
import WorkspacePageWithSections from '../WorkspacePageWithSections';
import WorkspaceTravelNoVBAView from './WorkspaceTravelNoVBAView';
import WorkspaceTravelVBAView from './WorkspaceTravelVBAView';
import CONST from '../../../CONST';
const propTypes = {
/** The route object passed to this page from the navigator */
route: PropTypes.shape({
/** Each parameter passed via the URL */
params: PropTypes.shape({
/** The policyID that is being configured */
policyID: PropTypes.string.isRequired,
}).isRequired,
}).isRequired,
...withLocalizePropTypes,
};
const WorkspaceTravelPage = props => (
<WorkspacePageWithSections
shouldUseScrollView
headerText={props.translate('workspace.common.travel')}
route={props.route}
guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_TRAVEL}
>
{(hasVBA, policyID) => (
<>
{!hasVBA && (
<WorkspaceTravelNoVBAView policyID={policyID} />
)}
{hasVBA && (
<WorkspaceTravelVBAView />
)}
</>
)}
</WorkspacePageWithSections>
);
WorkspaceTravelPage.propTypes = propTypes;
WorkspaceTravelPage.displayName = 'WorkspaceTravelPage';
export default withLocalize(WorkspaceTravelPage);