diff --git a/components/ProfileInfoCard.tsx b/components/ProfileInfoCard.tsx index b0c8b35..8a58a5b 100644 --- a/components/ProfileInfoCard.tsx +++ b/components/ProfileInfoCard.tsx @@ -20,8 +20,9 @@ import { DrawerTrigger, } from "@/components/ui/drawer" import { Input } from './ui/input'; -import { Share1Icon } from '@radix-ui/react-icons'; +import { Share1Icon, LightningBoltIcon, GlobeIcon } from '@radix-ui/react-icons'; import { toast } from './ui/use-toast'; +import { Globe } from 'lucide-react'; interface ProfileInfoCardProps { pubkey: string; @@ -47,6 +48,8 @@ const ProfileInfoCard: React.FC = React.memo(({ pubkey }) const title = userData?.username || userData?.display_name || userData?.name || userData?.npub || npubShortened; const description = userData?.about?.replace(/(?:\r\n|\r|\n)/g, '
'); const nip05 = userData?.nip05; + const lightningAddress = userData?.lud16; + const website = userData?.website; const handleCopyLink = async () => { try { @@ -80,6 +83,36 @@ const ProfileInfoCard: React.FC = React.memo(({ pubkey }) } }; + const handleCopyLightningAddress = async () => { + if (!lightningAddress) return; + + try { + await navigator.clipboard.writeText(lightningAddress); + toast({ + description: 'Lightning Address copied to clipboard', + title: 'Copied' + }); + } catch (err) { + toast({ + description: 'Error copying Lightning Address to clipboard', + title: 'Error', + variant: 'destructive' + }); + } + }; + + const handleOpenWebsite = () => { + if (!website) return; + + // Add https:// prefix if not present + let url = website; + if (!/^https?:\/\//i.test(url)) { + url = 'https://' + url; + } + + window.open(url, '_blank'); + }; + return (
@@ -95,6 +128,18 @@ const ProfileInfoCard: React.FC = React.memo(({ pubkey })
+ {lightningAddress && ( +
+ + {lightningAddress} +
+ )} + {website && ( +
+ + {website} +
+ )}
diff --git a/components/nip05.tsx b/components/nip05.tsx index 13cb714..4a0fac4 100644 --- a/components/nip05.tsx +++ b/components/nip05.tsx @@ -1,4 +1,5 @@ import { CheckIcon, ReloadIcon } from "@radix-ui/react-icons"; +import { BadgeCheck, Check } from "lucide-react"; import React, { useState, useEffect } from 'react'; interface NIP05Props { @@ -33,8 +34,14 @@ const NIP05: React.FC = ({ nip05, pubkey }) => {
{nip05.length > 0 && <> + {isLoading ? ( + + ) : isValid ? ( + + ) : ( + + )} { name === "_" ? domain : nip05 } - {isLoading ? : isValid ? : } }