/
OnboardingSuccessScreen.tsx
59 lines (52 loc) · 1.71 KB
/
OnboardingSuccessScreen.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
import colors from '@celo/react-components/styles/colors.v2'
import fontStyles from '@celo/react-components/styles/fonts.v2'
import { Spacing } from '@celo/react-components/styles/styles.v2'
import React, { useEffect } from 'react'
import { useTranslation } from 'react-i18next'
import { Image, StyleSheet, Text, View } from 'react-native'
import { Namespaces } from 'src/i18n'
import Logo, { LogoTypes } from 'src/icons/Logo.v2'
import { background } from 'src/images/Images'
import { nuxNavigationOptionsNoBackButton } from 'src/navigator/Headers.v2'
import { navigateHome } from 'src/navigator/NavigationService'
function OnboardingSuccessScreen() {
useEffect(() => {
const timeout = setTimeout(() => navigateHome(), 3000)
return () => clearTimeout(timeout)
}, [])
const { t } = useTranslation(Namespaces.onboarding)
return (
<View style={styles.container}>
<Image source={background} style={styles.backgroundImage} />
<Logo type={LogoTypes.LIGHT} height={70} />
<Text style={styles.text}>{t('success.message')}</Text>
</View>
)
}
OnboardingSuccessScreen.navigationOptions = nuxNavigationOptionsNoBackButton
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
backgroundImage: {
...StyleSheet.absoluteFillObject,
resizeMode: 'stretch',
width: undefined,
height: undefined,
},
text: {
...fontStyles.h2,
fontSize: 30,
lineHeight: 36,
color: colors.light,
marginTop: Spacing.Regular16,
marginBottom: 30,
shadowOffset: { width: 0, height: 1 },
shadowRadius: 2,
shadowOpacity: 1,
shadowColor: 'rgba(46, 51, 56, 0.15)',
},
})
export default OnboardingSuccessScreen