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

{post.comments}

-
-
- +
+ + +

+
+
); } diff --git a/client-solid/src/Components/Buttons/Engegament.tsx b/client-solid/src/Components/Buttons/Engegament.tsx index d6018f8..c768418 100644 --- a/client-solid/src/Components/Buttons/Engegament.tsx +++ b/client-solid/src/Components/Buttons/Engegament.tsx @@ -1,20 +1,19 @@ import { JSXElement } from "solid-js"; import { EngagementIcon } from "../../Util/Icons"; -import { Post } from "../../Util/api"; -export default function EngagementButton({ post }: { post: Post }): JSXElement { +export default function EngagementButton(): JSXElement { return ( <>
- -

{post.votes}

+ +

diff --git a/client-solid/src/Components/Buttons/RemovePostButton.tsx b/client-solid/src/Components/Buttons/RemovePostButton.tsx index 3d53908..50595f9 100644 --- a/client-solid/src/Components/Buttons/RemovePostButton.tsx +++ b/client-solid/src/Components/Buttons/RemovePostButton.tsx @@ -1,9 +1,8 @@ import { JSXElement } from "solid-js"; import { RemovePostIcon } from "../../Util/Icons"; -import { Post } from "../../Util/api"; -export default function RemovePostButton({ post }: { post: Post }): JSXElement { +export default function RemovePostButton(): JSXElement { return ( <>
diff --git a/client-solid/src/Components/Buttons/Reply.tsx b/client-solid/src/Components/Buttons/Reply.tsx index ead9dd7..21323b4 100644 --- a/client-solid/src/Components/Buttons/Reply.tsx +++ b/client-solid/src/Components/Buttons/Reply.tsx @@ -1,7 +1,7 @@ import { JSXElement, Show, useContext } from "solid-js"; import { LoginContext } from "../../Context/GlobalState"; -import { ReplyIcon, ReportIcon } from "../../Util/Icons"; +import { ReplyIcon } from "../../Util/Icons"; export default function ReplyButton(): JSXElement { const login_ctx = useContext(LoginContext)!; diff --git a/client-solid/src/Components/Buttons/ToPost.tsx b/client-solid/src/Components/Buttons/ToPost.tsx index f54d776..4e354b9 100644 --- a/client-solid/src/Components/Buttons/ToPost.tsx +++ b/client-solid/src/Components/Buttons/ToPost.tsx @@ -1,24 +1,21 @@ import { useNavigate } from "@solidjs/router"; import { JSXElement } from "solid-js"; - - import { Arrow } from "../../Util/Icons"; import { Post } from "../../Util/api"; - -export default function ToPostButton({ post }: { post: Post }): JSXElement { - const nav = useNavigate(); +export default function ToPostButton(props: { post: Post }): JSXElement { + const nav = useNavigate(); return (
); -} \ No newline at end of file +} diff --git a/client-solid/src/Components/Comment.tsx b/client-solid/src/Components/Comment.tsx index d986055..a021681 100644 --- a/client-solid/src/Components/Comment.tsx +++ b/client-solid/src/Components/Comment.tsx @@ -7,27 +7,23 @@ interface CommentProps { comment: PublicComment; } -/** - * Comment is a component that displays a single comment. - * @param {Object} props The properties for the Comment component. - * @param {string} props.postId The id of the post that the comment is a reply to. - * @returns {JSXElement} A JSXElement of a comment - */ -export function Comment({ comment }: CommentProps): JSXElement { +export function Comment(props: CommentProps): JSXElement { return ( <>
- +
-
{comment.content}
-
+
{props.comment.content}
+
- -
Replies to parent comment if any
+ +
Replies to parent comment if any
-
+
+ +
); } diff --git a/client-solid/src/Components/CommentSection.tsx b/client-solid/src/Components/CommentSection.tsx index 2baf64a..994553a 100644 --- a/client-solid/src/Components/CommentSection.tsx +++ b/client-solid/src/Components/CommentSection.tsx @@ -3,17 +3,13 @@ import { For, JSXElement, createResource } from "solid-js"; import { getComments } from "../Util/api"; import { Comment } from "./Comment"; -/** - * CommentSection is a component that displays a collection of comments. - * @param {Object} props The properties for the CommentSection component. - * @param {string} props.postId The id of the post that the comments are a reply to. - * @returns {JSXElement} A JSXElement that contains a collection of comments. - */ -export function CommentSection({ postId }: { postId: string }): JSXElement { - const [comments] = createResource(postId, () => getComments(postId, 10, 0)); +export function CommentSection(props: { postId: string }): JSXElement { + const [comments] = createResource(props.postId, () => + getComments(props.postId, 10, 0) + ); return ( -
+
{(comment) => }
); diff --git a/client-solid/src/Components/LoginButton.tsx b/client-solid/src/Components/LoginButton.tsx index 82fed43..b8bea26 100644 --- a/client-solid/src/Components/LoginButton.tsx +++ b/client-solid/src/Components/LoginButton.tsx @@ -1,7 +1,6 @@ import { JSXElement, Show, createSignal, useContext } from "solid-js"; import { LoginContext, ModalContext } from "../Context/GlobalState"; -import { UserCircle } from "../Util/Icons"; export function LoginButton(): JSXElement { const modal_ctx = useContext(ModalContext)!; @@ -35,7 +34,7 @@ export function LoginButton(): JSXElement { {showLogoutModal() && (