diff --git a/daily-thought-frontend/src/components/comments/Comment.tsx b/daily-thought-frontend/src/components/comments/Comment.tsx index 7d83228aca16507bdc7a5949255dcf94b91fee3a..91dea39b427feef2669d7fd99b6d9b8efa26e439 100644 --- a/daily-thought-frontend/src/components/comments/Comment.tsx +++ b/daily-thought-frontend/src/components/comments/Comment.tsx @@ -1,16 +1,12 @@ -import { Comment } from "@/types/comment" -import { HeartIcon } from '@heroicons/react/24/outline' -import { FC, PropsWithChildren } from "react" +import { Comment } from '@/types/comment'; +import { HeartIcon } from '@heroicons/react/24/outline'; +import { FC, PropsWithChildren } from 'react'; type CommentProps = { - Comment: Comment, - -} - -const Comment: FC<PropsWithChildren<CommentProps>> = ({ - Comment -}) => { + Comment: Comment; +}; +const Comment: FC<PropsWithChildren<CommentProps>> = ({ Comment }) => { return ( <div className="w-full flex items-center justify-between p-2"> <div className="flex flex-1"> @@ -18,15 +14,15 @@ const Comment: FC<PropsWithChildren<CommentProps>> = ({ <img className="h-8 w-8 rounded-full" src={Comment.User.profile} alt="" /> </div> <div> - <p className="text-xs font-bold">{Comment.User.name}</p> + <p className="text-xs font-bold">{Comment.User.username}</p> <p className="text-sm">This is my comment</p> <p className="text-xs text-gray-500">1 like</p> </div> </div> - + <HeartIcon className="block h-3 w-3" aria-hidden="true" /> </div> - ) -} + ); +}; -export default Comment; \ No newline at end of file +export default Comment; diff --git a/daily-thought-frontend/src/components/post/AnswerCard.tsx b/daily-thought-frontend/src/components/post/AnswerCard.tsx index f9e40ece46fe4c3598e6abc0fbfd4de53cb78296..fa25d768a285e61b4c4889d7cf1236fd6d8b3483 100644 --- a/daily-thought-frontend/src/components/post/AnswerCard.tsx +++ b/daily-thought-frontend/src/components/post/AnswerCard.tsx @@ -86,7 +86,7 @@ const AnswerCard: FC<PropsWithChildren<AnswerCardProps>> = ({ {comments.length > 0 && ( <div> <p className="text-xs text-gray-500 hover:text-c-pink">View all 3 comments</p> - <Comment Comment={{ Data: 'asdfg', User: user }} /> + <Comment Comment={{ Data: 'asdfg', User: user, Likes: [] }} /> </div> )} {comments.length === 0 && ( diff --git a/daily-thought-frontend/src/components/post/Post.tsx b/daily-thought-frontend/src/components/post/Post.tsx index 1cf5950f009af918fc292d38731c4c54db79bb3e..4c3d445ffd0835d68f708c22e6cd17b944ab4399 100644 --- a/daily-thought-frontend/src/components/post/Post.tsx +++ b/daily-thought-frontend/src/components/post/Post.tsx @@ -46,6 +46,7 @@ const Post: FC<PropsWithChildren<PostProps>> = ({ question={question} rehydrateFeed={() => rehydrateFeed()} userList={userList} + commentLimit={1} /> </div> </div> diff --git a/daily-thought-frontend/src/pages/userPost.tsx b/daily-thought-frontend/src/pages/userPost.tsx deleted file mode 100644 index a609924848a84535f0b4931ff128c33f5c2ed696..0000000000000000000000000000000000000000 --- a/daily-thought-frontend/src/pages/userPost.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import NavBar from "@/components/navigation/NavBar"; -import AnswerCard from "@/components/post/AnswerCard"; -import Post from "@/components/post/Post"; - -const user = { - Name: 'Tom Cook', - email: 'tom@example.com', - Username: 'TomCook', - Avatar: - 'https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80', -} - - -const UserPost = () => { - - return ( - <div className="min-h-screen bg-c-pink"> - <div className="w-full"> - <NavBar user={user} /> - </div> - <div className="flex w-full bg-c-pink flex-col items-center py-3 pt-10"> - <div className="flex-1 max-w-4xl flex items-center flex-col justify-center"> - <div className="p-8"> - <h1 className="text-4xl font-bold tracking-tight text-c-green text-center">This is my question of the day</h1> - </div> - <div className="rounded-full w-xl"> - - <div className="flex w-full justify-center flex-col items-center mx-auto p-3 sm:px-6 lg:px-8 max-w-4xl"> - <AnswerCard post={{User: user, Content: "This is my post"}}/> - </div> - </div> - - - </div> - </div> - </div> - ) -} - -export default UserPost; \ No newline at end of file