mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-10 23:47:12 +02:00
fix: pass event to RichText for custom emoji tag support
Create synthetic events that preserve emoji tags from the original highlight event while using the comment as content. This ensures custom emoji in comments render correctly. Changes: - HighlightRenderer: Create commentEvent with emoji tags preserved - HighlightDetailRenderer: Create commentEvent with emoji tags preserved
This commit is contained in:
@@ -39,6 +39,14 @@ export function Kind9802DetailRenderer({ event }: { event: NostrEvent }) {
|
||||
},
|
||||
);
|
||||
|
||||
// Create synthetic event for comment rendering (preserves emoji tags)
|
||||
const commentEvent = comment
|
||||
? {
|
||||
...event,
|
||||
content: comment,
|
||||
}
|
||||
: undefined;
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-6 p-6 max-w-3xl mx-auto">
|
||||
{/* Highlight Header */}
|
||||
@@ -76,13 +84,13 @@ export function Kind9802DetailRenderer({ event }: { event: NostrEvent }) {
|
||||
)}
|
||||
|
||||
{/* Comment */}
|
||||
{comment && (
|
||||
{commentEvent && (
|
||||
<div className="flex flex-col gap-2">
|
||||
<div className="text-xs text-muted-foreground uppercase tracking-wide">
|
||||
Comment
|
||||
</div>
|
||||
<RichText
|
||||
content={comment}
|
||||
event={commentEvent}
|
||||
className="text-sm leading-relaxed"
|
||||
options={{ showMedia: false, showEventEmbeds: false }}
|
||||
/>
|
||||
|
||||
@@ -49,13 +49,21 @@ export function Kind9802Renderer({ event }: BaseEventProps) {
|
||||
}
|
||||
};
|
||||
|
||||
// Create synthetic event for comment rendering (preserves emoji tags)
|
||||
const commentEvent = comment
|
||||
? {
|
||||
...event,
|
||||
content: comment,
|
||||
}
|
||||
: undefined;
|
||||
|
||||
return (
|
||||
<BaseEventContainer event={event}>
|
||||
<div className="flex flex-col gap-2">
|
||||
{/* Comment */}
|
||||
{comment && (
|
||||
{commentEvent && (
|
||||
<RichText
|
||||
content={comment}
|
||||
event={commentEvent}
|
||||
className="text-sm text-foreground"
|
||||
options={{ showMedia: false, showEventEmbeds: false }}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user