Add profile QR code for sharing and inviting friends (#10659)

This commit is contained in:
Spence Pope
2026-06-10 14:14:45 -04:00
committed by GitHub
parent adb39b4442
commit c6f9803676
32 changed files with 1853 additions and 55 deletions
@@ -28,6 +28,7 @@ import {Button, ButtonIcon, ButtonText} from '#/components/Button'
import {DebugFieldDisplay} from '#/components/DebugFieldDisplay'
import {useDialogControl} from '#/components/Dialog'
import {MessageProfileButton} from '#/components/dms/MessageProfileButton'
import {ArrowShareRight_Stroke2_Corner2_Rounded as ArrowShareRight} from '#/components/icons/ArrowShareRight'
import {PlusLarge_Stroke2_Corner0_Rounded as Plus} from '#/components/icons/Plus'
import {
KnownFollowers,
@@ -38,7 +39,9 @@ import * as Prompt from '#/components/Prompt'
import {RichText} from '#/components/RichText'
import * as Toast from '#/components/Toast'
import {Text} from '#/components/Typography'
import {IS_IOS} from '#/env'
import {useAnalytics} from '#/analytics'
import {IS_IOS, IS_NATIVE} from '#/env'
import {InviteFriendsDialog} from '#/features/inviteFriends'
import {useActorStatus} from '#/features/liveNow'
import {GermButton} from '../components/GermButton'
import {EditProfileDialog} from './EditProfileDialog'
@@ -238,6 +241,7 @@ export function HeaderStandardButtons({
minimal?: boolean
}) {
const {_} = useLingui()
const ax = useAnalytics()
const {hasSession, currentAccount} = useSession()
const playHaptic = useHaptics()
const requireAuth = useRequireAuth()
@@ -247,6 +251,7 @@ export function HeaderStandardButtons({
)
const [, queueUnblock] = useProfileBlockMutationQueue(profile)
const editProfileControl = useDialogControl()
const inviteFriendsControl = useDialogControl()
const unblockPromptControl = Prompt.usePromptControl()
const isMe = currentAccount?.did === profile.did
@@ -347,7 +352,25 @@ export function HeaderStandardButtons({
<Trans>Edit Profile</Trans>
</ButtonText>
</Button>
{/* Invite friends is a native-only share sheet (the dialog is a
no-op on web), so gate the entry point to avoid a dead button. */}
{IS_NATIVE && (
<Button
testID="profileHeaderShareButton"
size="small"
color="secondary"
shape="round"
onPress={() => {
playHaptic('Light')
ax.metric('invite:dialog:open', {logContext: 'ProfileHeader'})
inviteFriendsControl.open()
}}
label={_(msg`Invite friends`)}>
<ButtonIcon icon={ArrowShareRight} />
</Button>
)}
<EditProfileDialog profile={profile} control={editProfileControl} />
{IS_NATIVE && <InviteFriendsDialog control={inviteFriendsControl} />}
</>
) : profile.viewer?.blocking ? (
profile.viewer?.blockingByList ? null : (