From 27ab4af139be976efc9d1ab4e0ff1d6ab82a7fcf Mon Sep 17 00:00:00 2001 From: vineyardbovines Date: Tue, 9 Jun 2026 12:49:53 -0400 Subject: [PATCH] Address remaining PR review feedback for invite friends - Pin "New Feature" tag color to lightPalette in the announcement NUX so it stays legible against the always-light header illustration in dark mode (APP-2349) - Replace useEffect+eslint-disable with useCallOnce for the invite:nux:presented metric in InviteFriendsAnnouncement - Close the drawer when tapping share-to-invite so the dialog doesn't open over a still-open drawer - Lift the FollowersPromoBanner out of the empty-state early-return in ProfileFollowers so it renders independently of the placeholder/list switch --- .../nuxs/InviteFriendsAnnouncement.tsx | 21 ++++-- src/view/com/profile/ProfileFollowers.tsx | 68 +++++++++---------- src/view/shell/Drawer.tsx | 1 + 3 files changed, 49 insertions(+), 41 deletions(-) diff --git a/src/components/dialogs/nuxs/InviteFriendsAnnouncement.tsx b/src/components/dialogs/nuxs/InviteFriendsAnnouncement.tsx index 5bc04c86ba..70f4057d50 100644 --- a/src/components/dialogs/nuxs/InviteFriendsAnnouncement.tsx +++ b/src/components/dialogs/nuxs/InviteFriendsAnnouncement.tsx @@ -3,7 +3,9 @@ import {View} from 'react-native' import {Image} from 'expo-image' import {Trans, useLingui} from '@lingui/react/macro' +import {useCallOnce} from '#/lib/once' import {atoms as a, useTheme, web} from '#/alf' +import {themes} from '#/alf/themes' import {Button, ButtonText} from '#/components/Button' import * as Dialog from '#/components/Dialog' import {useNuxDialogContext} from '#/components/dialogs/nuxs' @@ -28,11 +30,12 @@ export function InviteFriendsAnnouncement() { Dialog.useAutoOpen(control) - useEffect(() => { + const firePresented = useCallOnce(() => { ax.metric('invite:nux:presented', {}) - // Fire once on mount - the NUX has a single lifecycle per session. - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []) + }) + useEffect(() => { + firePresented() + }, [firePresented]) const onClose = useCallback(() => { nuxDialogs.dismissActiveNux() @@ -87,10 +90,16 @@ export function InviteFriendsAnnouncement() { a.align_center, {top: 0, left: 0, right: 0, paddingTop: IS_WEB ? 24 : 20}, ]}> + {/* Pinned to the light palette: the header illustration has a + fixed light background, so the tag must stay dark in any + theme to remain legible. */} - + + style={[ + a.font_semi_bold, + {color: themes.lightPalette.primary_800}, + ]}> New Feature diff --git a/src/view/com/profile/ProfileFollowers.tsx b/src/view/com/profile/ProfileFollowers.tsx index 8fb7fef2bf..32ec6d6deb 100644 --- a/src/view/com/profile/ProfileFollowers.tsx +++ b/src/view/com/profile/ProfileFollowers.tsx @@ -184,15 +184,15 @@ export function ProfileFollowers({name}: {name: string}) { !isFollowersLoading && !isError - if (followers.length < 1) { - return ( - <> - {showFollowersPromo && ( - navigation.navigate('FindContactsSettings')} - onDismiss={() => setFollowersPromoDismissed(true)} - /> - )} + return ( + <> + {showFollowersPromo && ( + navigation.navigate('FindContactsSettings')} + onDismiss={() => setFollowersPromoDismissed(true)} + /> + )} + {followers.length < 1 ? ( navigation.goBack(), }} /> - - ) - } - - return ( - + } + // @ts-ignore our .web version only -prf + desktopFixedHeight + initialNumToRender={initialNumToRender} + windowSize={11} + sideBorders={false} /> - } - // @ts-ignore our .web version only -prf - desktopFixedHeight - initialNumToRender={initialNumToRender} - windowSize={11} - sideBorders={false} - /> + )} + ) } diff --git a/src/view/shell/Drawer.tsx b/src/view/shell/Drawer.tsx index 2806155a79..2e151fa832 100644 --- a/src/view/shell/Drawer.tsx +++ b/src/view/shell/Drawer.tsx @@ -331,6 +331,7 @@ let DrawerContent = ({}: React.PropsWithoutRef<{}>): React.ReactNode => { IS_NATIVE ? () => { ax.metric('invite:dialog:open', {logContext: 'Drawer'}) + setDrawerOpen(false) inviteFriendsControl.open() } : undefined