diff --git a/client/pages/Feed.tsx b/client/pages/Feed.tsx index e02326f4..2982c6ca 100644 --- a/client/pages/Feed.tsx +++ b/client/pages/Feed.tsx @@ -243,33 +243,11 @@ export default function Feed() { [toast, user?.id], ); - const handleComment = useCallback( - async (postId: string) => { - if (!user?.id) { - toast({ description: "Please sign in to comment." }); - return; - } - const content = prompt("Add a comment:")?.trim(); - if (!content) return; - try { - const created = await communityService.addComment( - postId, - user.id, - content, - ); - if (created) { - setItems((prev) => - prev.map((it) => - it.id === postId ? { ...it, comments: it.comments + 1 } : it, - ), - ); - } - } catch (e) { - console.warn("Comment failed", e); - } - }, - [toast, user?.id], - ); + const handleComment = useCallback((postId: string) => { + setItems((prev) => + prev.map((it) => (it.id === postId ? { ...it, comments: it.comments + 1 } : it)), + ); + }, []); const filteredItems = useMemo(() => { if (activeFilter === "following") { @@ -472,7 +450,10 @@ export default function Feed() { Compose - fetchFeed()} /> + fetchFeed()} + suggestedTags={trendingTopics.map((t) => t.topic.replace(/^#/, "")).slice(0, 8)} + />