-
Notifications
You must be signed in to change notification settings - Fork 2.9k
/
FinishChatCard.tsx
66 lines (60 loc) · 2.89 KB
/
FinishChatCard.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import React from 'react';
import Button from '@components/Button';
import * as Expensicons from '@components/Icon/Expensicons';
import * as Illustrations from '@components/Icon/Illustrations';
import MenuItem from '@components/MenuItem';
import ScrollView from '@components/ScrollView';
import Section from '@components/Section';
import Text from '@components/Text';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import WorkspaceResetBankAccountModal from '@pages/workspace/WorkspaceResetBankAccountModal';
import * as BankAccounts from '@userActions/BankAccounts';
import * as Report from '@userActions/Report';
import type {ReimbursementAccount} from '@src/types/onyx';
import Enable2FACard from './Enable2FACard';
type FinishChatCardProps = {
/** Bank account currently in setup */
reimbursementAccount: ReimbursementAccount;
/** Boolean required to display Enable2FACard component */
requiresTwoFactorAuth: boolean;
};
function FinishChatCard({requiresTwoFactorAuth, reimbursementAccount}: FinishChatCardProps) {
const {translate} = useLocalize();
const styles = useThemeStyles();
const policyID = reimbursementAccount?.achData?.policyID ?? '-1';
const shouldShowResetModal = reimbursementAccount.shouldShowResetModal ?? false;
const handleNavigateToConciergeChat = () => Report.navigateToConciergeChat(true);
return (
<ScrollView style={[styles.flex1]}>
<Section
title={translate('workspace.bankAccount.letsFinishInChat')}
icon={Illustrations.ConciergeBubble}
containerStyles={[styles.mb8, styles.mh5]}
titleStyles={[styles.mb3]}
>
<Text style={styles.mb6}>{translate('connectBankAccountStep.letsChatText')}</Text>
<Button
iconStyles={[styles.customMarginButtonWithMenuItem]}
text={translate('connectBankAccountStep.letsChatCTA')}
onPress={handleNavigateToConciergeChat}
icon={Expensicons.ChatBubble}
shouldShowRightIcon
success
innerStyles={[styles.pr2, styles.pl4, styles.h13]}
/>
<MenuItem
title={translate('workspace.bankAccount.noLetsStartOver')}
icon={Expensicons.RotateLeft}
onPress={BankAccounts.requestResetFreePlanBankAccount}
shouldShowRightIcon
wrapperStyle={[styles.cardMenuItem, styles.mv3]}
/>
</Section>
{!requiresTwoFactorAuth && <Enable2FACard policyID={policyID} />}
{shouldShowResetModal && <WorkspaceResetBankAccountModal reimbursementAccount={reimbursementAccount} />}
</ScrollView>
);
}
FinishChatCard.displayName = 'FinishChatCard';
export default FinishChatCard;