diff --git a/components/EditorOutput.tsx b/components/EditorOutput.tsx index 107b032..887b6c4 100644 --- a/components/EditorOutput.tsx +++ b/components/EditorOutput.tsx @@ -41,8 +41,8 @@ function CustomCodeRenderer({ data }: any) { data; return ( -
-{data.code}
++); } diff --git a/components/SubscribeLeaveToggle.tsx b/components/SubscribeLeaveToggle.tsx index 0e257ac..d6bae70 100644 --- a/components/SubscribeLeaveToggle.tsx +++ b/components/SubscribeLeaveToggle.tsx @@ -103,7 +103,7 @@ export default function SubscribeLeaveToggle({ if (err.response?.status === 402) { return toast({ title: "Creator cannot unsubscribe!", - description: "You're the creator this community 🪿", + description: "You're the creator of this community 🪿", }); } } @@ -121,7 +121,7 @@ export default function SubscribeLeaveToggle({ @@ -129,7 +129,7 @@ export default function SubscribeLeaveToggle({ diff --git a/components/pages/Communities.tsx b/components/pages/Communities.tsx index 9a98b36..3b62117 100644 --- a/components/pages/Communities.tsx +++ b/components/pages/Communities.tsx @@ -1,8 +1,8 @@ -"use client" +"use client"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; -import { Button, buttonVariants } from "@/components/ui/button"; -import { ChevronRight, Plus } from "lucide-react"; +import { Button } from "@/components/ui/button"; +import { ChevronRight, Menu, Plus } from "lucide-react"; import Link from "next/link"; import { useState } from "react"; @@ -10,61 +10,96 @@ type CommunityType = { name: string; members: string; avatar: string; + link: string; }; export function Communities() { const [isMenuOpen, setIsMenuOpen] = useState(false); return ( - //{data.code}
----Communities
- --diff --git a/components/pages/PostFeed.tsx b/components/pages/PostFeed.tsx index 8d1acf9..2e5d691 100644 --- a/components/pages/PostFeed.tsx +++ b/components/pages/PostFeed.tsx @@ -1,4 +1,5 @@ "use client"; + import { Infinite_Scrolling_Pagination_Results } from "@/config"; import { ExtendedPost } from "@/types/db"; import { useIntersection } from "@mantine/hooks"; @@ -12,6 +13,7 @@ interface PostFeedTypes { initialPosts: ExtendedPost[]; subgroupName?: string; } + export default function PostFeed({ initialPosts, subgroupName, @@ -54,7 +56,8 @@ export default function PostFeed({ const posts = data.pages.flatMap((page) => page) ?? initialPosts; return ( -- - - + + + +); } -function CommunityLink({ name, members, avatar }: CommunityType) { +function CommunityLink({ name, members, avatar, link }: CommunityType) { return ( -++++ +Communities
+ + + ++++ + + + --- -+ + -+ + {avatar} + +- {avatar} - --{name}++- + +{name}{members} members); } diff --git a/components/pages/Editor.tsx b/components/pages/Editor.tsx index c88e655..d911481 100644 --- a/components/pages/Editor.tsx +++ b/components/pages/Editor.tsx @@ -50,6 +50,7 @@ export default function Editor({ subgroupId }: { subgroupId: string }) { const LinkTool = (await import("@editorjs/link")).default; const InlineCode = (await import("@editorjs/inline-code")).default; const ImageTool = (await import("@editorjs/image")).default; + const Paragraph = (await import("@editorjs/paragraph")).default; if (!ref.current) { const editor = new EditorJS({ @@ -93,6 +94,7 @@ export default function Editor({ subgroupId }: { subgroupId: string }) { inlineCode: InlineCode, table: Table, embed: Embed, + paragraph: Paragraph, }, }); } @@ -196,10 +198,18 @@ export default function Editor({ subgroupId }: { subgroupId: string }) { // @ts-ignore _titleRef.current = e; }} + {...rest} placeholder="Title" className="w-full resize-none appearance-none overflow-hidden bg-transparent text-5xl font-bold focus:outline-none" /> + + Use{" "} + + Tab + {" "} + to open the command menu. +
+ //
+
{posts.map((post, index) => { const totalVotes = post.votes.reduce((acc, vote) => { if (vote.type === "UP") return acc + 1; diff --git a/components/pages/PostVoteClient.tsx b/components/pages/PostVoteClient.tsx index a1de505..0c38666 100644 --- a/components/pages/PostVoteClient.tsx +++ b/components/pages/PostVoteClient.tsx @@ -17,6 +17,7 @@ interface PostVoteClientProps { initialTotalVotes: number; initialVote: VoteType | null; } + export default function PostVoteClient({ postId, initialTotalVotes, @@ -77,13 +78,14 @@ export default function PostVoteClient({ }); return ( -
+{/* upvote */}