From 3abedb256c18a122544f487ac0d054915e623526 Mon Sep 17 00:00:00 2001
From: Imbus <>
Date: Sat, 23 Mar 2024 00:38:33 +0100
Subject: [PATCH] Making linter bro happy
---
client-solid/src/Components/Comment.tsx | 7 ++++---
client-solid/src/Components/CommentSection.tsx | 18 ++++++++++--------
2 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/client-solid/src/Components/Comment.tsx b/client-solid/src/Components/Comment.tsx
index 325d164..94fda21 100644
--- a/client-solid/src/Components/Comment.tsx
+++ b/client-solid/src/Components/Comment.tsx
@@ -1,4 +1,4 @@
-import { JSXElement } from "solid-js";
+import { JSXElement, splitProps } from "solid-js";
import { PublicComment } from "../Util/api";
@@ -7,12 +7,13 @@ interface CommentProps {
}
export function Comment(props: CommentProps): JSXElement {
+ const [local] = splitProps(props, ["comment"]);
return (
<>
-
+
- {props.comment.content}
+ {local.comment.content}
>
);
diff --git a/client-solid/src/Components/CommentSection.tsx b/client-solid/src/Components/CommentSection.tsx
index 994553a..cb3b830 100644
--- a/client-solid/src/Components/CommentSection.tsx
+++ b/client-solid/src/Components/CommentSection.tsx
@@ -1,16 +1,18 @@
-import { For, JSXElement, createResource } from "solid-js";
+import { For, JSXElement, createResource, splitProps } from "solid-js";
import { getComments } from "../Util/api";
import { Comment } from "./Comment";
-export function CommentSection(props: { postId: string }): JSXElement {
- const [comments] = createResource(props.postId, () =>
- getComments(props.postId, 10, 0)
- );
+export function CommentSection(postId: { postId: string }): JSXElement {
+ const [local] = splitProps(postId, ["postId"]);
+ // Not sure why this is a resource, refetch is not implemented
+ const [state] = createResource(() => getComments(local.postId, 10, 0));
return (
-
+
+ Loading...
}>
+ {(comment) => }
+
+
);
}