From 25bd4337c81afdaf2c5a32929d8499fd72688ca0 Mon Sep 17 00:00:00 2001 From: codytseng Date: Sat, 18 Jan 2025 18:07:18 +0800 Subject: [PATCH] feat: improve profile card --- src/components/ProfileCard/index.tsx | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/components/ProfileCard/index.tsx b/src/components/ProfileCard/index.tsx index 01eabb5f..1390212f 100644 --- a/src/components/ProfileCard/index.tsx +++ b/src/components/ProfileCard/index.tsx @@ -1,27 +1,17 @@ -import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar' import { useFetchProfile } from '@/hooks' -import { generateImageByPubkey } from '@/lib/pubkey' -import { useMemo } from 'react' import FollowButton from '../FollowButton' import Nip05 from '../Nip05' import ProfileAbout from '../ProfileAbout' +import { SimpleUserAvatar } from '../UserAvatar' export default function ProfileCard({ pubkey }: { pubkey: string }) { const { profile } = useFetchProfile(pubkey) - const defaultImage = useMemo(() => generateImageByPubkey(pubkey), [pubkey]) - - if (!profile) return null - const { avatar = '', username, nip05, about } = profile + const { username, nip05, about } = profile || {} return (
- - - - {pubkey} - - +