-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TS Migration] Migrate WorkspaceCard to Typescript
- Loading branch information
1 parent
c675857
commit 4feb092
Showing
6 changed files
with
117 additions
and
145 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React from 'react'; | ||
import {View} from 'react-native'; | ||
import ConnectBankAccountButton from '@components/ConnectBankAccountButton'; | ||
import * as Illustrations from '@components/Icon/Illustrations'; | ||
import Section from '@components/Section'; | ||
import Text from '@components/Text'; | ||
import UnorderedList from '@components/UnorderedList'; | ||
import useLocalize from '@hooks/useLocalize'; | ||
import useThemeStyles from '@hooks/useThemeStyles'; | ||
|
||
type WorkspaceCardNoVBAViewProps = { | ||
/** The policy ID currently being configured */ | ||
policyID: string; | ||
}; | ||
|
||
function WorkspaceCardNoVBAView({policyID}: WorkspaceCardNoVBAViewProps) { | ||
const styles = useThemeStyles(); | ||
const {translate} = useLocalize(); | ||
|
||
return ( | ||
<Section | ||
title={translate('workspace.card.header')} | ||
icon={Illustrations.CreditCardsNew} | ||
> | ||
<View style={[styles.mv4]}> | ||
<Text>{translate('workspace.card.noVBACopy')}</Text> | ||
</View> | ||
|
||
<UnorderedList items={[translate('workspace.card.benefit1'), translate('workspace.card.benefit2'), translate('workspace.card.benefit3'), translate('workspace.card.benefit4')]} /> | ||
<ConnectBankAccountButton | ||
policyID={policyID} | ||
style={[styles.mt6]} | ||
/> | ||
</Section> | ||
); | ||
} | ||
|
||
WorkspaceCardNoVBAView.displayName = 'WorkspaceCardNoVBAView'; | ||
|
||
export default WorkspaceCardNoVBAView; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import type {StackScreenProps} from '@react-navigation/stack'; | ||
import React from 'react'; | ||
import useLocalize from '@hooks/useLocalize'; | ||
import type {SettingsNavigatorParamList} from '@libs/Navigation/types'; | ||
import WorkspacePageWithSections from '@pages/workspace/WorkspacePageWithSections'; | ||
import CONST from '@src/CONST'; | ||
import type SCREENS from '@src/SCREENS'; | ||
import WorkspaceCardNoVBAView from './WorkspaceCardNoVBAView'; | ||
import WorkspaceCardVBANoECardView from './WorkspaceCardVBANoECardView'; | ||
import WorkspaceCardVBAWithECardView from './WorkspaceCardVBAWithECardView'; | ||
|
||
type WorkspaceCardPageProps = StackScreenProps<SettingsNavigatorParamList, typeof SCREENS.WORKSPACE.CARD>; | ||
|
||
function WorkspaceCardPage({route}: WorkspaceCardPageProps) { | ||
const {translate} = useLocalize(); | ||
|
||
return ( | ||
<WorkspacePageWithSections | ||
shouldUseScrollView | ||
headerText={translate('workspace.common.card')} | ||
route={route} | ||
guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_CARD} | ||
> | ||
{(hasVBA: boolean, policyID: string, isUsingECard: boolean) => ( | ||
<> | ||
{false && <WorkspaceCardNoVBAView policyID={policyID} />} | ||
|
||
{false && <WorkspaceCardVBANoECardView />} | ||
|
||
{true && <WorkspaceCardVBAWithECardView />} | ||
</> | ||
)} | ||
</WorkspacePageWithSections> | ||
); | ||
} | ||
|
||
WorkspaceCardPage.displayName = 'WorkspaceCardPage'; | ||
|
||
export default WorkspaceCardPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters