From e8327913676c11ce779b2eeec623b5baf93f78c4 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Fri, 24 Apr 2026 16:48:57 +0300 Subject: [PATCH] [Chat] Improve gate (#10359) --- src/components/Prompt.tsx | 27 ++++++++++++++++++++++----- src/screens/Messages/Conversation.tsx | 17 +++++++++++------ 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/src/components/Prompt.tsx b/src/components/Prompt.tsx index 80ece0c0c9..25b7f18840 100644 --- a/src/components/Prompt.tsx +++ b/src/components/Prompt.tsx @@ -3,7 +3,7 @@ import {type GestureResponderEvent, View} from 'react-native' import {msg} from '@lingui/core/macro' import {useLingui} from '@lingui/react' -import {atoms as a, useTheme, type ViewStyleProp, web} from '#/alf' +import {atoms as a, type TextStyleProp, useTheme, web} from '#/alf' import { Button, type ButtonColor, @@ -34,6 +34,8 @@ export function Outer({ control, testID, nativeOptions, + webOptions, + onClose, }: React.PropsWithChildren<{ control: Dialog.DialogControlProps testID?: string @@ -41,6 +43,13 @@ export function Outer({ * Native-specific options for the prompt. Extends `BottomSheetViewProps` */ nativeOptions?: Omit + /** + * Web-specific options for the prompt + */ + webOptions?: { + onBackgroundPress?: (e: GestureResponderEvent) => void + } + onClose?: () => void }>) { const titleId = useId() const descriptionId = useId() @@ -54,7 +63,8 @@ export function Outer({ @@ -72,7 +82,7 @@ export function Outer({ export function TitleText({ children, style, -}: React.PropsWithChildren) { +}: React.PropsWithChildren) { const {titleId} = useContext(Context) return ( ) { + style, +}: React.PropsWithChildren<{selectable?: boolean} & TextStyleProp>) { const t = useTheme() const {descriptionId} = useContext(Context) return ( + style={[ + a.text_md, + a.leading_snug, + t.atoms.text_contrast_high, + a.pb_lg, + style, + ]}> {children} ) diff --git a/src/screens/Messages/Conversation.tsx b/src/screens/Messages/Conversation.tsx index e0a6fd0794..6ff2955018 100644 --- a/src/screens/Messages/Conversation.tsx +++ b/src/screens/Messages/Conversation.tsx @@ -1,4 +1,4 @@ -import {useCallback, useEffect, useMemo, useState} from 'react' +import {useCallback, useEffect, useMemo, useRef, useState} from 'react' import {type LayoutChangeEvent, View} from 'react-native' import {useSafeAreaInsets} from 'react-native-safe-area-context' import {moderateProfile} from '@atproto/api' @@ -319,7 +319,10 @@ function GroupChatGate() { ax.features.GroupChatsHasBeenReleased, ) + const isAlreadyGoingBackRef = useRef(false) const onGoBack = () => { + if (isAlreadyGoingBackRef.current) return + isAlreadyGoingBackRef.current = true if (navigation.canGoBack()) { navigation.goBack() } else { @@ -330,27 +333,29 @@ function GroupChatGate() { return ( - - + + 🐴 - + {hasBeenReleased ? ( Group chats are now available ) : ( Group chats are not yet available )} - + {hasBeenReleased ? ( Update your app to the latest version to join in! ) : ( - This feature isn't available to you yet. Please check back later. + Hold your horses! This feature isn't available to you yet. Please + check back later. )}