-
Notifications
You must be signed in to change notification settings - Fork 2.9k
/
WorkspaceCardPage.js
50 lines (43 loc) · 1.67 KB
/
WorkspaceCardPage.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
46
47
48
49
50
import React from 'react';
import PropTypes from 'prop-types';
import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize';
import WorkspaceCardNoVBAView from './WorkspaceCardNoVBAView';
import WorkspaceCardVBANoECardView from './WorkspaceCardVBANoECardView';
import WorkspaceCardVBAWithECardView from './WorkspaceCardVBAWithECardView';
import WorkspacePageWithSections from '../WorkspacePageWithSections';
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 WorkspaceCardPage = props => (
<WorkspacePageWithSections
headerText={props.translate('workspace.common.card')}
route={props.route}
guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_CARD}
>
{(hasVBA, policyID, isUsingECard) => (
<>
{!hasVBA && (
<WorkspaceCardNoVBAView policyID={policyID} />
)}
{hasVBA && !isUsingECard && (
<WorkspaceCardVBANoECardView />
)}
{hasVBA && isUsingECard && (
<WorkspaceCardVBAWithECardView />
)}
</>
)}
</WorkspacePageWithSections>
);
WorkspaceCardPage.propTypes = propTypes;
WorkspaceCardPage.displayName = 'WorkspaceCardPage';
export default withLocalize(WorkspaceCardPage);