From 218c9977761cad8c32dbecd4209fdf2113ebf6f3 Mon Sep 17 00:00:00 2001 From: vineyardbovines Date: Tue, 2 Jun 2026 09:31:08 -0400 Subject: [PATCH] Address PR review feedback for invite friends - Remove commented-out Dialog.Handle in InviteFriendsDialog - Defer NUX -> invite handoff with requestAnimationFrame instead of setTimeout - Un-nest the dismiss Pressable in FollowersPromoBanner (avoids Android touch conflicts) - Drop redundant toLowerCase in getInviteShareUrl (handles are API-normalized, matches makeProfileLink) - Request write-only media library permission when saving the QR code - Migrate InviteFriendsAnnouncement to the l macro --- .../nuxs/InviteFriendsAnnouncement.tsx | 20 ++--- .../inviteFriends/InviteFriendsDialog.tsx | 1 - .../InviteFriendsDialogInner.tsx | 7 +- .../components/FollowersPromoBanner.tsx | 74 ++++++++++--------- src/features/inviteFriends/urls.test.ts | 8 +- src/features/inviteFriends/urls.ts | 2 +- 6 files changed, 58 insertions(+), 54 deletions(-) diff --git a/src/components/dialogs/nuxs/InviteFriendsAnnouncement.tsx b/src/components/dialogs/nuxs/InviteFriendsAnnouncement.tsx index 8a8577d807..1ef8c5dbbc 100644 --- a/src/components/dialogs/nuxs/InviteFriendsAnnouncement.tsx +++ b/src/components/dialogs/nuxs/InviteFriendsAnnouncement.tsx @@ -1,9 +1,7 @@ import {useCallback} from 'react' import {View} from 'react-native' import {Image} from 'expo-image' -import {msg} from '@lingui/core/macro' -import {useLingui} from '@lingui/react' -import {Trans} from '@lingui/react/macro' +import {Trans, useLingui} from '@lingui/react/macro' import {atoms as a, useTheme, web} from '#/alf' import {Button, ButtonText} from '#/components/Button' @@ -22,7 +20,7 @@ export const enabled = createIsEnabledCheck(() => { export function InviteFriendsAnnouncement() { const t = useTheme() - const {_} = useLingui() + const {t: l} = useLingui() const nuxDialogs = useNuxDialogContext() const control = Dialog.useDialogControl() @@ -37,9 +35,9 @@ export function InviteFriendsAnnouncement() { // the invite dialog. The invite dialog is mounted persistently by NuxDialogs // (not here) so it survives the dismissal - the native bottom sheet cannot // hand off to a second sheet mounted in this same subtree. Defer the open to - // the next tick so the announcement's teardown completes first. + // the next frame so the announcement's teardown completes first. control.close(() => { - setTimeout(() => nuxDialogs.openInviteFriends()) + requestAnimationFrame(() => nuxDialogs.openInviteFriends()) }) }, [control, nuxDialogs]) @@ -52,7 +50,7 @@ export function InviteFriendsAnnouncement() {