mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-10 15:36:53 +02:00
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:
@@ -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>
|
||||
)}
|
||||
|
||||
@@ -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 }}
|
||||
/>
|
||||
|
||||
@@ -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 }}
|
||||
/>
|
||||
|
||||
@@ -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 && (
|
||||
|
||||
@@ -100,7 +100,7 @@ export function Kind9802Renderer({ event }: BaseEventProps) {
|
||||
onClick={handleOpenEvent}
|
||||
>
|
||||
<RichText
|
||||
content={sourcePreview}
|
||||
event={{ ...sourceEvent, content: sourcePreview }}
|
||||
options={{ showMedia: false, showEventEmbeds: false }}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -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>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user