feat: 💨

This commit is contained in:
codytseng
2025-07-09 14:54:38 +08:00
parent 5d1427db31
commit f316ef1946
2 changed files with 13 additions and 13 deletions

View File

@@ -25,7 +25,7 @@ export default function Nip05({ pubkey, append }: { pubkey: string; append?: str
return (
<div
className="flex items-center gap-1 truncate [&_svg]:size-3.5 [&_svg]:shrink-0"
className="flex items-center gap-1 truncate [&_svg]:!size-3.5 [&_svg]:shrink-0"
onClick={(e) => e.stopPropagation()}
>
{nip05Name !== '_' ? (

View File

@@ -1,15 +1,16 @@
import { SecondaryPageLink } from '@/PageManager'
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'
import { CommandDialog, CommandInput, CommandItem, CommandList } from '@/components/ui/command'
import { useSearchProfiles } from '@/hooks'
import { toNote, toNoteList, toProfile, toProfileList, toRelay } from '@/lib/link'
import { generateImageByPubkey } from '@/lib/pubkey'
import { normalizeUrl } from '@/lib/url'
import { TProfile } from '@/types'
import { Hash, Notebook, Server, UserRound } from 'lucide-react'
import { nip19 } from 'nostr-tools'
import { Dispatch, useEffect, useMemo, useState } from 'react'
import { useTranslation } from 'react-i18next'
import Nip05 from '../Nip05'
import UserAvatar from '../UserAvatar'
import Username from '../Username'
export function SearchDialog({ open, setOpen }: { open: boolean; setOpen: Dispatch<boolean> }) {
const { t } = useTranslation()
@@ -142,16 +143,15 @@ function ProfileItem({ profile, onClick }: { profile: TProfile; onClick?: () =>
return (
<SecondaryPageLink to={toProfile(profile.pubkey)} onClick={onClick}>
<CommandItem value={`profile-${profile.pubkey}`}>
<div className="flex gap-2">
<Avatar>
<AvatarImage src={profile.avatar} alt={profile.username} />
<AvatarFallback>
<img src={generateImageByPubkey(profile.pubkey)} alt={profile.username} />
</AvatarFallback>
</Avatar>
<div>
<div className="font-semibold">{profile.username}</div>
<div className="line-clamp-1 text-muted-foreground">{profile.about}</div>
<div className="flex gap-2 items-center pointer-events-none">
<UserAvatar userId={profile.pubkey} className="shrink-0" />
<div className="w-full overflow-hidden">
<Username
userId={profile.pubkey}
className="font-semibold truncate max-w-full w-fit"
skeletonClassName="h-4"
/>
<Nip05 pubkey={profile.pubkey} />
</div>
</div>
</CommandItem>