diff --git a/src/components/ProfileSection.tsx b/src/components/ProfileSection.tsx index b441582..c2ab74a 100644 --- a/src/components/ProfileSection.tsx +++ b/src/components/ProfileSection.tsx @@ -14,9 +14,11 @@ import '../styles/author.css' import '../styles/innerPage.css' import '../styles/socialPosts.css' import { UserProfile } from '../types' -import { copyTextToClipboard, log, LogType, now } from '../utils' +import { copyTextToClipboard, log, LogType, now, npubToHex } from '../utils' import { LoadingSpinner } from './LoadingSpinner' import { ZapPopUp } from './Zap' +import { NDKUserProfile } from '@nostr-dev-kit/ndk' +import _ from 'lodash' type Props = { pubkey: string @@ -32,106 +34,13 @@ export const ProfileSection = ({ pubkey }: Props) => { }) }) - const handleCopy = async () => { - copyTextToClipboard(profile?.npub as string).then((isCopied) => { - if (isCopied) { - toast.success('Npub copied to clipboard!') - } else { - toast.error( - 'Failed to copy, look into console for more details on error!' - ) - } - }) - } - if (!profile) return null - const profileRoute = getProfilePageRoute( - nip19.nprofileEncode({ - pubkey - }) - ) - return (
- {profile.displayName || profile.name || ''} -
-- {profile.nip05 || ''} -
-- {profile.npub} -
-- {profile.bio || profile.about} -
- -{displayName}
+{nip05}
++ {npub} +
+{about}
+ +