diff --git a/src/components/Support.tsx b/src/components/Support.tsx index 0f5a9994..fe8661e1 100644 --- a/src/components/Support.tsx +++ b/src/components/Support.tsx @@ -8,6 +8,8 @@ import { fetchProfiles } from '../services/profileService' import { UserSettings } from '../services/settingsService' import { Models } from 'applesauce-core' import { useEventModel } from 'applesauce-react/hooks' +import { useNavigate } from 'react-router-dom' +import { nip19 } from 'nostr-tools' interface SupportProps { relayPool: RelayPool @@ -123,17 +125,23 @@ interface SupporterCardProps { } const SupporterCard: React.FC = ({ supporter, isWhale }) => { + const navigate = useNavigate() const profile = useEventModel(Models.ProfileModel, [supporter.pubkey]) const picture = profile?.picture const name = profile?.name || profile?.display_name || `${supporter.pubkey.slice(0, 8)}...` + const handleClick = () => { + const npub = nip19.npubEncode(supporter.pubkey) + navigate(`/p/${npub}`) + } + return (
{/* Avatar */}
= ({ supporter, isWhale }) => borderColor: isWhale ? undefined : 'var(--color-border)' }} title={`${name} • ${supporter.totalSats.toLocaleString()} sats`} + onClick={handleClick} > {picture ? (