forked from
jollywhoppers.com/witchsky.app
Bluesky app fork with some witchin' additions 💫
1import {useCallback} from 'react'
2import {View} from 'react-native'
3import {Image} from 'expo-image'
4import {msg} from '@lingui/core/macro'
5import {useLingui} from '@lingui/react'
6import {Trans} from '@lingui/react/macro'
7
8import {useEnableSquareButtons} from '#/state/preferences/enable-square-buttons'
9import {atoms as a, useTheme, web} from '#/alf'
10import {Button, ButtonText} from '#/components/Button'
11import * as Dialog from '#/components/Dialog'
12import {useNuxDialogContext} from '#/components/dialogs/nuxs'
13import {Sparkle_Stroke2_Corner0_Rounded as SparkleIcon} from '#/components/icons/Sparkle'
14import {Text} from '#/components/Typography'
15import {IS_WEB} from '#/env'
16
17export function ActivitySubscriptionsNUX() {
18 const t = useTheme()
19 const {_} = useLingui()
20 const nuxDialogs = useNuxDialogContext()
21 const control = Dialog.useDialogControl()
22
23 const enableSquareButtons = useEnableSquareButtons()
24
25 Dialog.useAutoOpen(control)
26
27 const onClose = useCallback(() => {
28 nuxDialogs.dismissActiveNux()
29 }, [nuxDialogs])
30
31 return (
32 <Dialog.Outer control={control} onClose={onClose}>
33 <Dialog.Handle />
34
35 <Dialog.ScrollableInner
36 label={_(msg`Introducing activity notifications`)}
37 style={[web({maxWidth: 400})]}
38 contentContainerStyle={[
39 {
40 paddingTop: 0,
41 paddingLeft: 0,
42 paddingRight: 0,
43 },
44 ]}>
45 <View
46 style={[
47 a.align_center,
48 a.overflow_hidden,
49 t.atoms.bg_contrast_25,
50 {
51 gap: IS_WEB ? 16 : 24,
52 paddingTop: IS_WEB ? 24 : 48,
53 borderTopLeftRadius: a.rounded_md.borderRadius,
54 borderTopRightRadius: a.rounded_md.borderRadius,
55 },
56 ]}>
57 <View
58 style={[
59 a.pl_sm,
60 a.pr_md,
61 a.py_sm,
62 enableSquareButtons ? a.rounded_sm : a.rounded_full,
63 a.flex_row,
64 a.align_center,
65 a.gap_xs,
66 {
67 backgroundColor: t.palette.primary_100,
68 },
69 ]}>
70 <SparkleIcon fill={t.palette.primary_800} size="sm" />
71 <Text
72 style={[
73 a.font_semi_bold,
74 {
75 color: t.palette.primary_800,
76 },
77 ]}>
78 <Trans>New Feature</Trans>
79 </Text>
80 </View>
81
82 <View style={[a.relative, a.w_full]}>
83 <View
84 style={[
85 a.absolute,
86 t.atoms.bg_contrast_25,
87 t.atoms.shadow_md,
88 {
89 shadowOpacity: 0.4,
90 top: 5,
91 bottom: 0,
92 left: '17%',
93 right: '17%',
94 width: '66%',
95 borderTopLeftRadius: 40,
96 borderTopRightRadius: 40,
97 },
98 ]}
99 />
100 <View
101 style={[
102 a.overflow_hidden,
103 {
104 aspectRatio: 398 / 228,
105 },
106 ]}>
107 <Image
108 accessibilityIgnoresInvertColors
109 source={require('../../../../assets/images/activity_notifications_announcement.webp')}
110 style={[
111 a.w_full,
112 {
113 aspectRatio: 398 / 268,
114 },
115 ]}
116 alt={_(
117 msg`A screenshot of a profile page with a bell icon next to the follow button, indicating the new activity notifications feature.`,
118 )}
119 />
120 </View>
121 </View>
122 </View>
123 <View
124 style={[
125 a.align_center,
126 a.px_xl,
127 IS_WEB ? [a.pt_xl, a.gap_xl, a.pb_sm] : [a.pt_3xl, a.gap_3xl],
128 ]}>
129 <View style={[a.gap_md, a.align_center]}>
130 <Text
131 style={[
132 a.text_3xl,
133 a.leading_tight,
134 a.font_bold,
135 a.text_center,
136 {
137 fontSize: IS_WEB ? 28 : 32,
138 maxWidth: 300,
139 },
140 ]}>
141 <Trans>Get notified when someone posts</Trans>
142 </Text>
143 <Text
144 style={[
145 a.text_md,
146 a.leading_snug,
147 a.text_center,
148 {
149 maxWidth: 340,
150 },
151 ]}>
152 <Trans>
153 You can now choose to be notified when specific people post. If
154 there’s someone you want timely updates from, go to their
155 profile and find the new bell icon near the follow button.
156 </Trans>
157 </Text>
158 </View>
159
160 {!IS_WEB && (
161 <Button
162 label={_(msg`Close`)}
163 size="large"
164 variant="solid"
165 color="primary"
166 onPress={() => {
167 control.close()
168 }}
169 style={[a.w_full, {maxWidth: 280}]}>
170 <ButtonText>
171 <Trans>Close</Trans>
172 </ButtonText>
173 </Button>
174 )}
175 </View>
176
177 <Dialog.Close />
178 </Dialog.ScrollableInner>
179 </Dialog.Outer>
180 )
181}