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