feat: collapsible event references in chat

This commit is contained in:
2023-08-02 18:59:01 +02:00
parent a11eeef698
commit 08d554aa8f
11 changed files with 246 additions and 53 deletions

View File

@ -14,6 +14,7 @@ import { Emoji as EmojiComponent } from "element/emoji";
import { Profile } from "./profile";
import { Text } from "element/text";
import { SendZapsDialog } from "element/send-zap";
import { CollapsibleEvent } from "element/collapsible";
import { useLogin } from "hooks/login";
import { formatSats } from "number";
import { findTag } from "utils";
@ -30,6 +31,10 @@ function emojifyReaction(reaction: string) {
return reaction;
}
const customComponents = {
Event: CollapsibleEvent,
};
export function ChatMessage({
streamer,
ev,
@ -159,7 +164,11 @@ export function ChatMessage({
pubkey={ev.pubkey}
profile={profile}
/>
<Text tags={ev.tags} content={ev.content} />
<Text
tags={ev.tags}
content={ev.content}
customComponents={customComponents}
/>
{(hasReactions || hasZaps) && (
<div className="message-reactions">
{hasZaps && (