mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
1import React from 'react'
2import {View} from 'react-native'
3import {useSafeAreaInsets} from 'react-native-safe-area-context'
4import {msg, Trans} from '@lingui/macro'
5import {useLingui} from '@lingui/react'
6
7import {Logo} from '#/view/icons/Logo'
8import {Logotype} from '#/view/icons/Logotype'
9import {ErrorBoundary} from 'view/com/util/ErrorBoundary'
10import {atoms as a, useTheme} from '#/alf'
11import {AppLanguageDropdown} from '#/components/AppLanguageDropdown'
12import {Button, ButtonText} from '#/components/Button'
13import {Text} from '#/components/Typography'
14import {CenteredView} from '../util/Views'
15
16export const SplashScreen = ({
17 onPressSignin,
18 onPressCreateAccount,
19}: {
20 onPressSignin: () => void
21 onPressCreateAccount: () => void
22}) => {
23 const t = useTheme()
24 const {_} = useLingui()
25
26 const insets = useSafeAreaInsets()
27
28 return (
29 <CenteredView style={[a.h_full, a.flex_1]}>
30 <ErrorBoundary>
31 <View style={[{flex: 1}, a.justify_center, a.align_center]}>
32 <Logo width={92} fill="sky" />
33
34 <View style={[a.pb_sm, a.pt_5xl]}>
35 <Logotype width={161} fill={t.atoms.text.color} />
36 </View>
37
38 <Text
39 style={[a.text_md, a.font_semibold, t.atoms.text_contrast_medium]}>
40 <Trans>What's up?</Trans>
41 </Text>
42 </View>
43 <View testID="signinOrCreateAccount">
44 <Button
45 testID="createAccountButton"
46 onPress={onPressCreateAccount}
47 accessibilityRole="button"
48 label={_(msg`Create new account`)}
49 accessibilityHint={_(
50 msg`Opens flow to create a new Bluesky account`,
51 )}
52 style={[a.mx_xl, a.mb_xl]}
53 size="large"
54 variant="solid"
55 color="primary">
56 <ButtonText>
57 <Trans>Create a new account</Trans>
58 </ButtonText>
59 </Button>
60 <Button
61 testID="signInButton"
62 onPress={onPressSignin}
63 label={_(msg`Sign in`)}
64 accessibilityHint={_(
65 msg`Opens flow to sign into your existing Bluesky account`,
66 )}
67 style={[a.mx_xl, a.mb_xl]}
68 size="large"
69 variant="solid"
70 color="secondary">
71 <ButtonText>
72 <Trans>Sign in</Trans>
73 </ButtonText>
74 </Button>
75 </View>
76 <View
77 style={[
78 a.px_lg,
79 a.pt_md,
80 a.pb_2xl,
81 a.justify_center,
82 a.align_center,
83 ]}>
84 <AppLanguageDropdown />
85 </View>
86 <View style={{height: insets.bottom}} />
87 </ErrorBoundary>
88 </CenteredView>
89 )
90}