From a13fd7a78930236e12e1b6cc838bb022f29f3ecf Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Wed, 10 Dec 2025 11:56:46 +0200 Subject: [PATCH] add inviteinfo component --- .../contacts/components/InviteInfo.tsx | 85 +++++++++++++++++++ .../contacts/screens/ViewMatches.tsx | 29 +++++-- 2 files changed, 109 insertions(+), 5 deletions(-) create mode 100644 src/components/contacts/components/InviteInfo.tsx diff --git a/src/components/contacts/components/InviteInfo.tsx b/src/components/contacts/components/InviteInfo.tsx new file mode 100644 index 0000000000..54100a2a01 --- /dev/null +++ b/src/components/contacts/components/InviteInfo.tsx @@ -0,0 +1,85 @@ +import {type StyleProp, type TextStyle} from 'react-native' +import {msg, Trans} from '@lingui/macro' +import {useLingui} from '@lingui/react' + +import {HITSLOP_20} from '#/lib/constants' +import {android, atoms as a} from '#/alf' +import {Button, ButtonText} from '#/components/Button' +import * as Dialog from '#/components/Dialog' +import {CircleInfo_Stroke2_Corner0_Rounded as InfoIcon} from '#/components/icons/CircleInfo' +import {Text} from '#/components/Typography' + +export function InviteInfo({ + iconStyle, + iconOffset = 0, +}: { + iconStyle: StyleProp + /** + * Adjust the vertical position of the icon via `translateY` + * + * @platform android + */ + iconOffset?: number +}) { + const {_} = useLingui() + const control = Dialog.useDialogControl() + + const style = [a.text_md, a.leading_snug, a.mt_xs] + + return ( + <> + + + + + + + Invite Friends + + + + It looks like some of your contacts have not tried to find you + here yet. You can personally invite them by customizing a draft + message we will provide. + + + + How it works: + + + • Choose who to invite + + + • Personalize the message + + + • Send the message from your phone + + + •{' '} + + We don't store your friends' phone numbers or send any messages + + + + + + + + ) +} diff --git a/src/components/contacts/screens/ViewMatches.tsx b/src/components/contacts/screens/ViewMatches.tsx index d3e97ca459..5922e0d60c 100644 --- a/src/components/contacts/screens/ViewMatches.tsx +++ b/src/components/contacts/screens/ViewMatches.tsx @@ -35,6 +35,7 @@ import * as ProfileCard from '#/components/ProfileCard' import * as Toast from '#/components/Toast' import {Text} from '#/components/Typography' import type * as bsky from '#/types/bsky' +import {InviteInfo} from '../components/InviteInfo' import {type Action, type Contact, type State} from '../state' type Item = @@ -71,6 +72,7 @@ export function ViewMatches({ state: Extract dispatch: React.ActionDispatch<[Action]> }) { + const t = useTheme() const {_} = useLingui() const gutter = useGutters([0, 'wide']) const moderationOpts = useModerationOpts() @@ -278,15 +280,32 @@ export function ViewMatches({ ) case 'contacts header': - return
+ return ( +
+ Invite friends{' '} + + + } + hasContentAbove + /> + ) case 'no matches header': return (
+ Bluesky is more fun with friends. Do you want to invite some of + yours?{' '} + + + } /> ) case 'search empty state': @@ -402,7 +421,7 @@ function ContactItem({contact}: {contact: Contact}) { const {_} = useLingui() const {currentAccount} = useSession() - const name = contact.firstName ?? contact.lastName + const name = contact.firstName ?? contact.lastName ?? contact.name const phone = contact.phoneNumbers?.find(phone => phone.isPrimary) ?? contact.phoneNumbers?.[0]