Bluesky app fork with some witchin' additions 💫 witchsky.app
bluesky fork client
117
fork

Configure Feed

Select the types of activity you want to include in your feed.

[Chat] Improve gate (#10359)

authored by

Samuel Newman and committed by
GitHub
e8327913 deb3f26d

+33 -11
+22 -5
src/components/Prompt.tsx
··· 3 3 import {msg} from '@lingui/core/macro' 4 4 import {useLingui} from '@lingui/react' 5 5 6 - import {atoms as a, useTheme, type ViewStyleProp, web} from '#/alf' 6 + import {atoms as a, type TextStyleProp, useTheme, web} from '#/alf' 7 7 import { 8 8 Button, 9 9 type ButtonColor, ··· 34 34 control, 35 35 testID, 36 36 nativeOptions, 37 + webOptions, 38 + onClose, 37 39 }: React.PropsWithChildren<{ 38 40 control: Dialog.DialogControlProps 39 41 testID?: string ··· 41 43 * Native-specific options for the prompt. Extends `BottomSheetViewProps` 42 44 */ 43 45 nativeOptions?: Omit<BottomSheetViewProps, 'children'> 46 + /** 47 + * Web-specific options for the prompt 48 + */ 49 + webOptions?: { 50 + onBackgroundPress?: (e: GestureResponderEvent) => void 51 + } 52 + onClose?: () => void 44 53 }>) { 45 54 const titleId = useId() 46 55 const descriptionId = useId() ··· 54 63 <Dialog.Outer 55 64 control={control} 56 65 testID={testID} 57 - webOptions={{alignCenter: true}} 66 + onClose={onClose} 67 + webOptions={{alignCenter: true, ...webOptions}} 58 68 nativeOptions={{preventExpansion: true, ...nativeOptions}}> 59 69 <Dialog.Handle /> 60 70 <Context.Provider value={context}> ··· 72 82 export function TitleText({ 73 83 children, 74 84 style, 75 - }: React.PropsWithChildren<ViewStyleProp>) { 85 + }: React.PropsWithChildren<TextStyleProp>) { 76 86 const {titleId} = useContext(Context) 77 87 return ( 78 88 <Text ··· 93 103 export function DescriptionText({ 94 104 children, 95 105 selectable, 96 - }: React.PropsWithChildren<{selectable?: boolean}>) { 106 + style, 107 + }: React.PropsWithChildren<{selectable?: boolean} & TextStyleProp>) { 97 108 const t = useTheme() 98 109 const {descriptionId} = useContext(Context) 99 110 return ( 100 111 <Text 101 112 nativeID={descriptionId} 102 113 selectable={selectable} 103 - style={[a.text_md, a.leading_snug, t.atoms.text_contrast_high, a.pb_lg]}> 114 + style={[ 115 + a.text_md, 116 + a.leading_snug, 117 + t.atoms.text_contrast_high, 118 + a.pb_lg, 119 + style, 120 + ]}> 104 121 {children} 105 122 </Text> 106 123 )
+11 -6
src/screens/Messages/Conversation.tsx
··· 1 - import {useCallback, useEffect, useMemo, useState} from 'react' 1 + import {useCallback, useEffect, useMemo, useRef, useState} from 'react' 2 2 import {type LayoutChangeEvent, View} from 'react-native' 3 3 import {useSafeAreaInsets} from 'react-native-safe-area-context' 4 4 import {moderateProfile} from '@atproto/api' ··· 319 319 ax.features.GroupChatsHasBeenReleased, 320 320 ) 321 321 322 + const isAlreadyGoingBackRef = useRef(false) 322 323 const onGoBack = () => { 324 + if (isAlreadyGoingBackRef.current) return 325 + isAlreadyGoingBackRef.current = true 323 326 if (navigation.canGoBack()) { 324 327 navigation.goBack() 325 328 } else { ··· 330 333 return ( 331 334 <Prompt.Outer 332 335 control={groupChatGateDialogControl} 336 + onClose={onGoBack} 333 337 nativeOptions={{preventDismiss: true, preventExpansion: true}} 334 338 testID="groupChatGateDialog"> 335 339 <Prompt.Content> 336 - <View style={[a.w_full, a.align_center, a.py_2xl]}> 337 - <Text style={{fontSize: 48}} emoji> 340 + <View style={[a.w_full, a.align_center, a.py_3xl]}> 341 + <Text style={{fontSize: 72}} emoji> 338 342 🐴 339 343 </Text> 340 344 </View> 341 - <Prompt.TitleText> 345 + <Prompt.TitleText style={[a.text_center]}> 342 346 {hasBeenReleased ? ( 343 347 <Trans>Group chats are now available</Trans> 344 348 ) : ( 345 349 <Trans>Group chats are not yet available</Trans> 346 350 )} 347 351 </Prompt.TitleText> 348 - <Prompt.DescriptionText> 352 + <Prompt.DescriptionText style={[a.text_center]}> 349 353 {hasBeenReleased ? ( 350 354 <Trans>Update your app to the latest version to join in!</Trans> 351 355 ) : ( 352 356 <Trans> 353 - This feature isn't available to you yet. Please check back later. 357 + Hold your horses! This feature isn't available to you yet. Please 358 + check back later. 354 359 </Trans> 355 360 )} 356 361 </Prompt.DescriptionText>