forked from
jollywhoppers.com/witchsky.app
Bluesky app fork with some witchin' additions 馃挮
1import {View} from 'react-native'
2import {msg} from '@lingui/core/macro'
3import {useLingui} from '@lingui/react'
4import {Trans} from '@lingui/react/macro'
5
6import {atoms as a, platform, tokens, useBreakpoints, useTheme} from '#/alf'
7import {Button, ButtonText} from '#/components/Button'
8import {useDialogContext} from '#/components/Dialog'
9import {
10 ScreenID,
11 type ScreenProps,
12} from '#/components/dialogs/EmailDialog/types'
13import {Divider} from '#/components/Divider'
14import {GradientFill} from '#/components/GradientFill'
15import {ShieldCheck_Stroke2_Corner0_Rounded as ShieldIcon} from '#/components/icons/Shield'
16import {Text} from '#/components/Typography'
17
18export function VerificationReminder({
19 showScreen,
20}: ScreenProps<ScreenID.VerificationReminder>) {
21 const t = useTheme()
22 const {_} = useLingui()
23 const {gtPhone, gtMobile} = useBreakpoints()
24 const control = useDialogContext()
25
26 const dialogPadding = gtMobile ? a.p_2xl.padding : a.p_xl.padding
27
28 // FIXME: the usage of "tokens.gradients.summer" here is temporary,
29 // its the closest thats built into bluesky that matches witchskys color scheme
30 // someone, preferbly xan, should edit src/alf/tokens.ts to have proper witchsky colors
31 // maybe even support all the other themes too?
32
33 return (
34 <View style={[a.gap_lg]}>
35 <View
36 style={[
37 a.absolute,
38 {
39 top: platform({web: dialogPadding, default: a.p_2xl.padding}) * -1,
40 left: dialogPadding * -1,
41 right: dialogPadding * -1,
42 height: 150,
43 },
44 ]}>
45 <View
46 style={[
47 a.absolute,
48 a.inset_0,
49 a.align_center,
50 a.justify_center,
51 a.overflow_hidden,
52 a.pt_md,
53 t.atoms.bg_contrast_100,
54 {
55 borderTopLeftRadius: a.rounded_md.borderRadius,
56 borderTopRightRadius: a.rounded_md.borderRadius,
57 },
58 ]}>
59 <GradientFill gradient={tokens.gradients.summer} />
60 <ShieldIcon width={64} fill="white" style={[a.z_10]} />
61 </View>
62 </View>
63
64 <View style={[a.mb_xs, {height: 150 - dialogPadding}]} />
65
66 <View style={[a.gap_sm]}>
67 <Text style={[a.text_xl, a.font_bold]}>
68 <Trans>Please verify your email</Trans>
69 </Text>
70 <Text style={[a.text_sm, a.leading_snug, t.atoms.text_contrast_medium]}>
71 <Trans>
72 Your email has not yet been verified. Please verify your email in
73 order to enjoy all the features of Witchsky.
74 </Trans>
75 </Text>
76 </View>
77
78 <Divider />
79
80 <View style={[a.gap_sm, gtPhone && [a.flex_row_reverse]]}>
81 <Button
82 label={_(msg`Get started`)}
83 variant="solid"
84 color="primary"
85 size="large"
86 onPress={() =>
87 showScreen({
88 id: ScreenID.Verify,
89 })
90 }>
91 <ButtonText>
92 <Trans>Get started</Trans>
93 </ButtonText>
94 </Button>
95 <Button
96 label={_(msg`Maybe later`)}
97 accessibilityHint={_(msg`Snoozes the reminder`)}
98 variant="ghost"
99 color="secondary"
100 size="large"
101 onPress={() => control.close()}>
102 <ButtonText>
103 <Trans>Maybe later</Trans>
104 </ButtonText>
105 </Button>
106 </View>
107 </View>
108 )
109}