feat: support NIP-30 custom emojis in bio and display name (#660)

This commit is contained in:
Alex Gleason 2025-11-14 08:01:29 -06:00 committed by GitHub
parent f8cca5522f
commit 82c13006ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 105 additions and 11 deletions

View file

@ -1,3 +1,4 @@
import TextWithEmojis from '@/components/TextWithEmojis'
import { useFetchProfile } from '@/hooks'
import { formatUserId } from '@/lib/pubkey'
import { cn } from '@/lib/utils'
@ -11,7 +12,11 @@ export default function MentionNode(props: NodeViewRendererProps & { selected: b
className={cn('inline text-primary', props.selected ? 'bg-primary/20 rounded-sm' : '')}
>
{'@'}
{profile ? profile.username : formatUserId(props.node.attrs.id)}
{profile ? (
<TextWithEmojis text={profile.username} emojis={profile.emojis} emojiClassName="mb-1" />
) : (
formatUserId(props.node.attrs.id)
)}
</NodeViewWrapper>
)
}