-
Notifications
You must be signed in to change notification settings - Fork 3k
/
Copy pathUpgradeIntro.tsx
79 lines (75 loc) · 3.44 KB
/
UpgradeIntro.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
67
68
69
70
71
72
73
74
75
76
77
78
79
import React from 'react';
import {View} from 'react-native';
import Badge from '@components/Badge';
import Button from '@components/Button';
import Icon from '@components/Icon';
import * as Expensicon from '@components/Icon/Expensicons';
import * as Illustrations from '@components/Icon/Illustrations';
import Text from '@components/Text';
import TextLink from '@components/TextLink';
import useLocalize from '@hooks/useLocalize';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useThemeStyles from '@hooks/useThemeStyles';
import Navigation from '@libs/Navigation/Navigation';
import variables from '@styles/variables';
import type CONST from '@src/CONST';
import ROUTES from '@src/ROUTES';
type Props = {
buttonDisabled?: boolean;
loading?: boolean;
feature: (typeof CONST.UPGRADE_FEATURE_INTRO_MAPPING)[0];
onUpgrade: () => void;
};
function UpgradeIntro({feature, onUpgrade, buttonDisabled, loading}: Props) {
const styles = useThemeStyles();
const {isExtraSmallScreenWidth, isSmallScreenWidth} = useResponsiveLayout();
const {translate} = useLocalize();
return (
<View style={styles.p5}>
<View style={styles.workspaceUpgradeIntroBox({isExtraSmallScreenWidth, isSmallScreenWidth})}>
<View style={[styles.mb3, styles.flexRow, styles.justifyContentBetween]}>
<Icon
src={Illustrations[feature.icon]}
width={variables.iconSizeExtraLarge}
height={variables.iconSizeExtraLarge}
/>
<Badge
icon={Expensicon.Unlock}
text={translate('workspace.upgrade.upgradeToUnlock')}
success
/>
</View>
<View style={styles.mb5}>
<Text style={[styles.textHeadlineH1, styles.mb4]}>{translate(feature.title)}</Text>
<Text style={[styles.textNormal, styles.textSupporting, styles.mb4]}>{translate(feature.description)}</Text>
<Text style={[styles.textNormal, styles.textSupporting]}>
{translate(`workspace.upgrade.${feature.id}.pricing.onlyAvailableOnPlan`)}
<Text style={[styles.textWhite, styles.textBold]}>{translate(`workspace.upgrade.${feature.id}.pricing.amount`)}</Text>
{translate(`workspace.upgrade.${feature.id}.pricing.perActiveMember`)}
</Text>
</View>
<Button
isLoading={loading}
text={translate('common.upgrade')}
success
onPress={onUpgrade}
isDisabled={buttonDisabled}
large
/>
</View>
<View style={styles.mt6}>
<Text style={[styles.textNormal, styles.textSupporting]}>
{translate('workspace.upgrade.note.upgradeWorkspace')}{' '}
<TextLink
style={[styles.link]}
onPress={() => Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION)}
>
{translate('workspace.upgrade.note.learnMore')}
</TextLink>{' '}
{translate('workspace.upgrade.note.aboutOurPlans')}
</Text>
</View>
</View>
);
}
export default UpgradeIntro;