diff --git a/client-solid/src/Components/Buttons/CommentsButton.tsx b/client-solid/src/Components/Buttons/CommentsButton.tsx new file mode 100644 index 0000000..700c7b0 --- /dev/null +++ b/client-solid/src/Components/Buttons/CommentsButton.tsx @@ -0,0 +1,17 @@ +import { JSXElement } from "solid-js"; + +import { CommentsIcon } from "../../Util/Icons"; +import { Post } from "../../Util/api"; + +export default function CommentsBUtton({ post }: { post: Post }): JSXElement { + return ( + <> +
+ + +

{post.comments}

+
+
+ + ); +} diff --git a/client-solid/src/Components/Buttons/Replies.tsx b/client-solid/src/Components/Buttons/Replies.tsx deleted file mode 100644 index fe702e8..0000000 --- a/client-solid/src/Components/Buttons/Replies.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { JSXElement } from "solid-js"; - -import { ReplyIcon } from "../../Util/Icons"; -import { Post } from "../../Util/api"; - -export default function ReplyButton({ post }: { post: Post }): JSXElement { - return ( - <> -
- - -

{post.comments}

-
-
- - ); -} diff --git a/client-solid/src/Components/Buttons/Reply.tsx b/client-solid/src/Components/Buttons/Reply.tsx new file mode 100644 index 0000000..ead9dd7 --- /dev/null +++ b/client-solid/src/Components/Buttons/Reply.tsx @@ -0,0 +1,20 @@ +import { JSXElement, Show, useContext } from "solid-js"; + +import { LoginContext } from "../../Context/GlobalState"; +import { ReplyIcon, ReportIcon } from "../../Util/Icons"; + +export default function ReplyButton(): JSXElement { + const login_ctx = useContext(LoginContext)!; + return ( + +
+ +
+
+ ); +} diff --git a/client-solid/src/Components/Comment.tsx b/client-solid/src/Components/Comment.tsx index bdc61c4..d986055 100644 --- a/client-solid/src/Components/Comment.tsx +++ b/client-solid/src/Components/Comment.tsx @@ -1,6 +1,7 @@ import { JSXElement } from "solid-js"; import { PublicComment } from "../Util/api"; +import ReplyButton from "./Buttons/Reply"; interface CommentProps { comment: PublicComment; @@ -15,14 +16,18 @@ interface CommentProps { export function Comment({ comment }: CommentProps): JSXElement { return ( <> -
+
-
{comment.content}
+
{comment.content}
+
- -
Replies to parent comment if any
+
+ +
Replies to parent comment if any
+
+
); } diff --git a/client-solid/src/Components/LoginButton.tsx b/client-solid/src/Components/LoginButton.tsx index 53dce5d..82fed43 100644 --- a/client-solid/src/Components/LoginButton.tsx +++ b/client-solid/src/Components/LoginButton.tsx @@ -35,7 +35,7 @@ export function LoginButton(): JSXElement { {showLogoutModal() && (