diff --git a/src/components/feed/NoteCard.tsx b/src/components/feed/NoteCard.tsx index 07832f0..82a0383 100644 --- a/src/components/feed/NoteCard.tsx +++ b/src/components/feed/NoteCard.tsx @@ -6,9 +6,10 @@ import { useUserStore } from "../../stores/user"; import { useMuteStore } from "../../stores/mute"; import { useUIStore } from "../../stores/ui"; import { timeAgo, shortenPubkey } from "../../lib/utils"; -import { publishReaction, publishReply, getNDK } from "../../lib/nostr"; +import { publishReaction, publishReply, publishRepost, getNDK } from "../../lib/nostr"; import { NoteContent } from "./NoteContent"; import { ZapModal } from "../zap/ZapModal"; +import { QuoteModal } from "./QuoteModal"; interface NoteCardProps { event: NDKEvent; @@ -40,6 +41,9 @@ export function NoteCard({ event }: NoteCardProps) { const [replySent, setReplySent] = useState(false); const replyRef = useRef(null); const [showZap, setShowZap] = useState(false); + const [showQuote, setShowQuote] = useState(false); + const [reposting, setReposting] = useState(false); + const [reposted, setReposted] = useState(false); const [menuOpen, setMenuOpen] = useState(false); const handleLike = async () => { @@ -83,6 +87,17 @@ export function NoteCard({ event }: NoteCardProps) { if (e.key === "Escape") setShowReply(false); }; + const handleRepost = async () => { + if (reposting || reposted) return; + setReposting(true); + try { + await publishRepost(event); + setReposted(true); + } finally { + setReposting(false); + } + }; + return (
@@ -169,6 +184,21 @@ export function NoteCard({ event }: NoteCardProps) { > {liked ? "♥" : "♡"}{reactionCount !== null && reactionCount > 0 ? ` ${reactionCount}` : liked ? " liked" : " like"} + + +
+ + {/* Compose */} +
+