mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
1import {useCallback} from 'react'
2import {View} from 'react-native'
3import {Image} from 'expo-image'
4import {msg, Trans} from '@lingui/macro'
5import {useLingui} from '@lingui/react'
6
7import {urls} from '#/lib/constants'
8import {logger} from '#/logger'
9import {isNative} from '#/platform/detection'
10import {atoms as a, useBreakpoints, useTheme} from '#/alf'
11import {Button, ButtonText} from '#/components/Button'
12import * as Dialog from '#/components/Dialog'
13import {useNuxDialogContext} from '#/components/dialogs/nuxs'
14import {Sparkle_Stroke2_Corner0_Rounded as SparkleIcon} from '#/components/icons/Sparkle'
15import {VerifierCheck} from '#/components/icons/VerifierCheck'
16import {Link} from '#/components/Link'
17import {Span, Text} from '#/components/Typography'
18
19export function InitialVerificationAnnouncement() {
20 const t = useTheme()
21 const {_} = useLingui()
22 const {gtMobile} = useBreakpoints()
23 const nuxDialogs = useNuxDialogContext()
24 const control = Dialog.useDialogControl()
25
26 Dialog.useAutoOpen(control)
27
28 const onClose = useCallback(() => {
29 nuxDialogs.dismissActiveNux()
30 }, [nuxDialogs])
31
32 return (
33 <Dialog.Outer control={control} onClose={onClose}>
34 <Dialog.Handle />
35
36 <Dialog.ScrollableInner
37 label={_(msg`Announcing verification on Bluesky`)}
38 style={[
39 gtMobile ? {width: 'auto', maxWidth: 400, minWidth: 200} : a.w_full,
40 ]}>
41 <View style={[a.align_start, a.gap_xl]}>
42 <View
43 style={[
44 a.pl_sm,
45 a.pr_md,
46 a.py_sm,
47 a.rounded_full,
48 a.flex_row,
49 a.align_center,
50 a.gap_xs,
51 {
52 backgroundColor: t.palette.primary_25,
53 },
54 ]}>
55 <SparkleIcon fill={t.palette.primary_700} size="sm" />
56 <Text
57 style={[
58 a.font_bold,
59 {
60 color: t.palette.primary_700,
61 },
62 ]}>
63 <Trans>New Feature</Trans>
64 </Text>
65 </View>
66
67 <View
68 style={[
69 a.w_full,
70 a.rounded_md,
71 a.overflow_hidden,
72 t.atoms.bg_contrast_25,
73 {minHeight: 100},
74 ]}>
75 <Image
76 accessibilityIgnoresInvertColors
77 source={require('../../../../assets/images/initial_verification_announcement_1.png')}
78 style={[
79 {
80 aspectRatio: 353 / 160,
81 },
82 ]}
83 alt={_(
84 msg`An illustration showing that Bluesky selects trusted verifiers, and trusted verifiers in turn verify individual user accounts.`,
85 )}
86 />
87 </View>
88
89 <View style={[a.gap_xs]}>
90 <Text style={[a.text_2xl, a.font_bold, a.leading_snug]}>
91 <Trans>A new form of verification</Trans>
92 </Text>
93 <Text style={[a.leading_snug, a.text_md]}>
94 <Trans>
95 We’re introducing a new layer of verification on Bluesky — an
96 easy-to-see checkmark.
97 </Trans>
98 </Text>
99 </View>
100
101 <View
102 style={[
103 a.w_full,
104 a.rounded_md,
105 a.overflow_hidden,
106 t.atoms.bg_contrast_25,
107 {minHeight: 100},
108 ]}>
109 <Image
110 accessibilityIgnoresInvertColors
111 source={require('../../../../assets/images/initial_verification_announcement_2.png')}
112 style={[
113 {
114 aspectRatio: 353 / 196,
115 },
116 ]}
117 alt={_(
118 msg`An mockup of a iPhone showing the Bluesky app open to the profile of a verified user with a blue checkmark next to their display name.`,
119 )}
120 />
121 </View>
122
123 <View style={[a.gap_sm]}>
124 <View style={[a.flex_row, a.align_center, a.gap_xs]}>
125 <VerifierCheck width={14} />
126 <Text style={[a.text_lg, a.font_bold, a.leading_snug]}>
127 <Trans>Who can verify?</Trans>
128 </Text>
129 </View>
130 <View style={[a.gap_sm]}>
131 <Text style={[a.leading_snug, a.text_md]}>
132 <Trans>
133 Bluesky will proactively verify notable and authentic
134 accounts.
135 </Trans>
136 </Text>
137 <Text style={[a.leading_snug, a.text_md]}>
138 <Trans>
139 Trust emerges from relationships, communities, and shared
140 context, so we’re also enabling{' '}
141 <Span style={[a.font_bold]}>trusted verifiers</Span>:
142 organizations that can directly issue verification.
143 </Trans>
144 </Text>
145 <Text style={[a.leading_snug, a.text_md]}>
146 <Trans>
147 When you tap on a check, you’ll see which organizations have
148 granted verification.
149 </Trans>
150 </Text>
151 </View>
152 </View>
153
154 <View style={[a.w_full, a.gap_md]}>
155 <Link
156 overridePresentation
157 to={urls.website.blog.initialVerificationAnnouncement}
158 label={_(msg`Read blog post`)}
159 size="small"
160 variant="solid"
161 color="primary"
162 style={[a.justify_center, a.w_full]}
163 onPress={() => {
164 logger.metric(
165 'verification:learn-more',
166 {
167 location: 'initialAnnouncementeNux',
168 },
169 {statsig: false},
170 )
171 }}>
172 <ButtonText>
173 <Trans>Read blog post</Trans>
174 </ButtonText>
175 </Link>
176 {isNative && (
177 <Button
178 label={_(msg`Close`)}
179 size="small"
180 variant="solid"
181 color="secondary"
182 style={[a.justify_center, a.w_full]}
183 onPress={() => {
184 control.close()
185 }}>
186 <ButtonText>
187 <Trans>Close</Trans>
188 </ButtonText>
189 </Button>
190 )}
191 </View>
192 </View>
193
194 <Dialog.Close />
195 </Dialog.ScrollableInner>
196 </Dialog.Outer>
197 )
198}