-
Notifications
You must be signed in to change notification settings - Fork 2.9k
/
WorkspaceBillsPage.tsx
41 lines (36 loc) · 1.74 KB
/
WorkspaceBillsPage.tsx
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
import type {StackScreenProps} from '@react-navigation/stack';
import React from 'react';
import {View} from 'react-native';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import useWindowDimensions from '@hooks/useWindowDimensions';
import type {WorkspacesCentralPaneNavigatorParamList} from '@navigation/types';
import WorkspacePageWithSections from '@pages/workspace/WorkspacePageWithSections';
import CONST from '@src/CONST';
import type SCREENS from '@src/SCREENS';
import WorkspaceBillsNoVBAView from './WorkspaceBillsNoVBAView';
import WorkspaceBillsVBAView from './WorkspaceBillsVBAView';
type WorkspaceBillsPageProps = StackScreenProps<WorkspacesCentralPaneNavigatorParamList, typeof SCREENS.WORKSPACE.BILLS>;
function WorkspaceBillsPage({route}: WorkspaceBillsPageProps) {
const {translate} = useLocalize();
const styles = useThemeStyles();
const {isSmallScreenWidth} = useWindowDimensions();
return (
<WorkspacePageWithSections
shouldUseScrollView
headerText={translate('workspace.common.bills')}
route={route}
guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_BILLS}
shouldShowOfflineIndicatorInWideScreen
>
{(hasVBA: boolean, policyID: string) => (
<View style={[styles.mt3, isSmallScreenWidth ? styles.workspaceSectionMobile : styles.workspaceSection]}>
{!hasVBA && <WorkspaceBillsNoVBAView policyID={policyID} />}
{hasVBA && <WorkspaceBillsVBAView policyID={policyID} />}
</View>
)}
</WorkspacePageWithSections>
);
}
WorkspaceBillsPage.displayName = 'WorkspaceBillsPage';
export default WorkspaceBillsPage;