fix: pass original event to RichText for custom emoji support

Updated 6 components to pass the full event object to RichText instead
of just the content string. This ensures custom emoji tags from the
original event are available for proper rendering.

- ProfileViewer.tsx: pass profileEvent for about section
- ProfileRenderer.tsx: pass event for about section
- FileMetadataRenderer.tsx: pass event for summary
- GenericRepostCompactPreview.tsx: pass repostedEvent for preview
- compact/index.tsx: pass event in DefaultCompactPreview
- HighlightRenderer.tsx: pass sourceEvent for source preview
This commit is contained in:
Claude
2026-01-19 16:13:34 +00:00
parent 8f008ddd39
commit 149aefa05f
6 changed files with 16 additions and 6 deletions

View File

@@ -413,7 +413,12 @@ export function ProfileViewer({ pubkey }: ProfileViewerProps) {
</div>
<RichText
className="text-sm whitespace-pre-wrap break-words"
content={profile.about}
event={
profileEvent
? { ...profileEvent, content: profile.about }
: undefined
}
content={profileEvent ? undefined : profile.about}
/>
</div>
)}

View File

@@ -53,7 +53,7 @@ export function GenericRepostCompactPreview({ event }: { event: NostrEvent }) {
/>
<span className="truncate line-clamp-1">
<RichText
content={preview || ""}
event={{ ...repostedEvent, content: preview || "" }}
className="inline text-sm leading-none"
options={{ showMedia: false, showEventEmbeds: false }}
/>

View File

@@ -77,7 +77,7 @@ export function DefaultCompactPreview({ event }: { event: NostrEvent }) {
<span className="truncate line-clamp-1 text-muted-foreground text-sm">
{hasSpecificTitle ? (
<RichText
content={title}
event={{ ...event, content: title }}
className="inline text-sm leading-none"
options={{ showMedia: false, showEventEmbeds: false }}
/>

View File

@@ -103,7 +103,12 @@ export function Kind1063Renderer({ event }: BaseEventProps) {
</div>
{/* Description/Summary */}
{summary && <RichText content={summary} className="text-sm" />}
{summary && (
<RichText
event={{ ...event, content: summary }}
className="text-sm"
/>
)}
{/* Download button */}
{metadata.url && (

View File

@@ -100,7 +100,7 @@ export function Kind9802Renderer({ event }: BaseEventProps) {
onClick={handleOpenEvent}
>
<RichText
content={sourcePreview}
event={{ ...sourceEvent, content: sourcePreview }}
options={{ showMedia: false, showEventEmbeds: false }}
/>
</div>

View File

@@ -40,7 +40,7 @@ export function Kind0Renderer({ event }: BaseEventProps) {
{/* About */}
{about && (
<p className="text-sm text-muted-foreground line-clamp-5">
<RichText content={about} />
<RichText event={{ ...event, content: about }} />
</p>
)}