Skip to content

Commit b582d47

Browse files
authored
Added send id to account page when no send tags (#1408)
1 parent c9eff2b commit b582d47

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

packages/app/components/ReferralLink.tsx

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@ import { CheckCheck } from '@tamagui/lucide-icons'
1313
import { useEffect, useState } from 'react'
1414
import { IconCopy } from './icons'
1515
import * as Clipboard from 'expo-clipboard'
16+
import { useConfirmedTags } from 'app/utils/tags'
1617

1718
export function ReferralLink(props: ButtonProps) {
18-
const { profile, tags } = useUser()
19-
const referralCode = tags?.[0]?.name || profile?.referral_code
19+
const { profile } = useUser()
20+
const send_id = profile?.send_id
21+
const tags = useConfirmedTags()
22+
const referralCode = tags?.[0]?.name
2023
const referralHref = `https://send.app?referral=${referralCode}`
2124
const toast = useToastController()
2225
const [hasCopied, setHasCopied] = useState(false)
@@ -42,7 +45,18 @@ export function ReferralLink(props: ButtonProps) {
4245
}
4346
}, [hasCopied])
4447

45-
if (!referralCode) return null
48+
if (!referralCode) {
49+
return (
50+
<XStack ai={'center'} gap={'$2'} width={'100%'}>
51+
<Paragraph size={'$5'} color={'$color10'}>
52+
Send ID:
53+
</Paragraph>
54+
<Paragraph fontSize={'$5'} fontWeight={'500'}>
55+
{send_id}
56+
</Paragraph>
57+
</XStack>
58+
)
59+
}
4660

4761
return (
4862
<XStack ai={'center'} gap={'$2'} width={'100%'}>

packages/app/features/account/components/AccountHeader.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ import { ReferralLink } from 'app/components/ReferralLink'
66
import { useEffect, useState } from 'react'
77
import * as Sharing from 'expo-sharing'
88
import { useHoverStyles } from 'app/utils/useHoverStyles'
9+
import { useConfirmedTags } from 'app/utils/tags'
910

1011
export const AccountHeader = (props: YStackProps) => {
11-
const { profile, tags } = useUser()
12+
const { profile } = useUser()
13+
const tags = useConfirmedTags()
1214
const avatar_url = profile?.avatar_url
1315
const name = profile?.name
1416
const referralCode = tags?.[0]?.name || profile?.referral_code

0 commit comments

Comments
 (0)