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