diff --git a/client/app/app/posts/[id]/page.jsx b/client/app/app/posts/[id]/page.jsx index a9918fe..45df90c 100644 --- a/client/app/app/posts/[id]/page.jsx +++ b/client/app/app/posts/[id]/page.jsx @@ -16,7 +16,7 @@ export default function Page({ params }) { } useEffect(() => { - const fetchUser = async () => { + const fetchPost = async () => { const response = await getPost(params); if (!response) { toast({ @@ -29,7 +29,7 @@ export default function Page({ params }) { setPost(response.data.post); }; - fetchUser(); + fetchPost(); }, []); return ( diff --git a/client/components/app/Comment/index.jsx b/client/components/app/Comment/index.jsx index 1425c2f..cb93fd4 100644 --- a/client/components/app/Comment/index.jsx +++ b/client/components/app/Comment/index.jsx @@ -1,7 +1,5 @@ import { useState } from 'react'; import UserHoverCard from '@/components/app/HoverCard'; -import { Skeleton } from '@/components/ui/skeleton'; -import { Button } from '@/components/ui/button'; import Dropdown from '@/components/app/Comment/Dropdown'; import LikeButton from '@/components/app/Comment/LikeButton'; @@ -14,26 +12,17 @@ export default function Comment({ comment: initialComment, onDelete }) {
- {comment ? ( - <> - -
@{comment.author.username}
- - ) : ( - <> - - - - )} + +
@{comment.author.username}
- {comment ? comment.content : } + {comment.content}
- {comment ? : } +
); diff --git a/client/components/app/Post/index.jsx b/client/components/app/Post/index.jsx index 67aad40..e0fd683 100644 --- a/client/components/app/Post/index.jsx +++ b/client/components/app/Post/index.jsx @@ -1,6 +1,5 @@ import { useState } from 'react'; import Dropdown from '@/components/app/Post/Dropdown'; -import { Skeleton } from '@/components/ui/skeleton'; import UserHoverCard from '@/components/app/HoverCard'; import LikeButton from '@/components/app/Post/LikeButton'; import CommentButton from '@/components/app/Post/CommentButton'; @@ -14,17 +13,8 @@ export default function Post({ post: initialPost, onDelete, onNewComment }) {
- {post ? ( - <> - -
@{post.author.username}
- - ) : ( - <> - - - - )} + +
@{post.author.username}
{/*
@@ -34,20 +24,11 @@ export default function Post({ post: initialPost, onDelete, onNewComment }) {
- {post ? post.content : } + {post.content}
- {post ? ( - <> - - - - ) : ( - <> - - - - )} + +
);