diff --git a/client-solid/src/Components/Buttons/CommentsButton.tsx b/client-solid/src/Components/Buttons/CommentsButton.tsx index a9bec4c..5c7dfef 100644 --- a/client-solid/src/Components/Buttons/CommentsButton.tsx +++ b/client-solid/src/Components/Buttons/CommentsButton.tsx @@ -1,10 +1,18 @@ -import { JSXElement, createSignal, onMount } from "solid-js"; +import { useNavigate } from "@solidjs/router"; +import { JSXElement, createEffect, createSignal, onMount } from "solid-js"; import { CommentsIcon } from "../../Util/Icons"; import { getCommentCount } from "../../Util/api"; export default function CommentsButton(props: { postId: string }): JSXElement { const [commentCount, setCommentCount] = createSignal(0); + const [postId, setPostId] = createSignal(""); + + const nav = useNavigate(); + + createEffect(() => { + setPostId(props.postId); + }); const handleComments = async (): Promise => { try { @@ -20,7 +28,12 @@ export default function CommentsButton(props: { postId: string }): JSXElement { return (
- +

diff --git a/client-solid/src/Components/PostSegment.tsx b/client-solid/src/Components/PostSegment.tsx index cf5c6c2..5578f0f 100644 --- a/client-solid/src/Components/PostSegment.tsx +++ b/client-solid/src/Components/PostSegment.tsx @@ -16,7 +16,7 @@ export function PostSegment(props: { post: Post }): JSXElement {

-

{dateOfCreation}

+

{dateOfCreation}