-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathAccountCreateStart.tsx
More file actions
88 lines (84 loc) · 2.62 KB
/
Copy pathAccountCreateStart.tsx
File metadata and controls
88 lines (84 loc) · 2.62 KB
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
80
81
82
83
84
85
86
87
88
import React, { memo, useCallback } from 'react'
import { useTranslation } from 'react-i18next'
import CreateAccount from '@assets/images/createAccount.svg'
import { useNavigation } from '@react-navigation/native'
import Box from '@components/Box'
import Text from '@components/Text'
import ButtonPressable from '@components/ButtonPressable'
import BackButton from '@components/BackButton'
import SafeAreaBox from '@components/SafeAreaBox'
import { useAccountStorage } from '../../../storage/AccountStorageProvider'
import { CreateAccountNavigationProp } from './createAccountNavTypes'
type Props = { onCreate: () => void; inline?: boolean }
const AccountCreateStart = ({ onCreate, inline }: Props) => {
const { t } = useTranslation()
const { reachedAccountLimit } = useAccountStorage()
const navigation = useNavigation<CreateAccountNavigationProp>()
const onClose = useCallback(() => {
navigation.goBack()
}, [navigation])
return (
<SafeAreaBox
flex={1}
backgroundColor="secondaryBackground"
paddingHorizontal="l"
>
<Box width="100%" alignItems="flex-start" visible={!inline}>
<BackButton onPress={onClose} />
</Box>
<Box justifyContent="center" alignItems="center" flex={1}>
<CreateAccount />
<Text
variant="h1"
fontSize={44}
textAlign="center"
lineHeight={44}
marginTop="l"
>
{t('accountSetup.title')}
</Text>
<Text
variant="subtitle1"
textAlign="center"
color="secondaryText"
marginVertical="m"
>
{t('accountSetup.subtitle1')}
</Text>
<Text
variant="subtitle1"
textAlign="center"
color="greenBright500"
visible={!reachedAccountLimit}
>
{t('accountSetup.subtitle2')}
</Text>
</Box>
<Text
visible={reachedAccountLimit}
variant="body1"
textAlign="center"
color="error"
fontWeight="500"
marginBottom="l"
>
{t('accountImport.accountLimit')}
</Text>
<ButtonPressable
disabled={reachedAccountLimit}
borderRadius="round"
titleColor="secondary"
fontWeight="500"
title={t('accountSetup.createButtonTitle')}
backgroundColor="greenBright500"
backgroundColorOpacityPressed={0.7}
backgroundColorDisabled="surfaceSecondary"
backgroundColorDisabledOpacity={0.5}
titleColorDisabled="black500"
marginBottom="l"
onPress={onCreate}
/>
</SafeAreaBox>
)
}
export default memo(AccountCreateStart)