Accept pubkey for chat popup
This commit is contained in:
@ -1,20 +1,22 @@
|
||||
import "./chat-popout.css";
|
||||
import { LiveChat } from "element/live-chat";
|
||||
import { useParams } from "react-router-dom";
|
||||
import { parseNostrLink } from "@snort/system";
|
||||
import useEventFeed from "../hooks/event-feed";
|
||||
import { NostrPrefix, encodeTLV, parseNostrLink } from "@snort/system";
|
||||
import { useCurrentStreamFeed } from "hooks/current-stream-feed";
|
||||
import { findTag } from "utils";
|
||||
|
||||
export function ChatPopout() {
|
||||
const params = useParams();
|
||||
const link = parseNostrLink(params.id!);
|
||||
const { data: ev } = useEventFeed(link, true);
|
||||
const ev = useCurrentStreamFeed(link, true);
|
||||
|
||||
const lnk = parseNostrLink(encodeTLV(NostrPrefix.Address, findTag(ev, "d") ?? "", undefined, ev?.kind, ev?.pubkey));
|
||||
const chat = Boolean(new URL(window.location.href).searchParams.get("chat"));
|
||||
return (
|
||||
<div className={`popout-chat${chat ? "" : " embed"}`}>
|
||||
<LiveChat
|
||||
ev={ev}
|
||||
link={link}
|
||||
link={lnk}
|
||||
options={{
|
||||
canWrite: chat,
|
||||
showHeader: false,
|
||||
|
Reference in New Issue
Block a user