Skip to content
Snippets Groups Projects
Commit 002c7bcc authored by Matt Kirby's avatar Matt Kirby
Browse files

Fixing nextjs build errors

parent 134b004a
No related branches found
No related tags found
1 merge request!24Fe questions and posts (This one is big)
import { Comment } from "@/types/comment" import { Comment } from '@/types/comment';
import { HeartIcon } from '@heroicons/react/24/outline' import { HeartIcon } from '@heroicons/react/24/outline';
import { FC, PropsWithChildren } from "react" import { FC, PropsWithChildren } from 'react';
type CommentProps = { type CommentProps = {
Comment: Comment, Comment: Comment;
};
}
const Comment: FC<PropsWithChildren<CommentProps>> = ({
Comment
}) => {
const Comment: FC<PropsWithChildren<CommentProps>> = ({ Comment }) => {
return ( return (
<div className="w-full flex items-center justify-between p-2"> <div className="w-full flex items-center justify-between p-2">
<div className="flex flex-1"> <div className="flex flex-1">
...@@ -18,15 +14,15 @@ const Comment: FC<PropsWithChildren<CommentProps>> = ({ ...@@ -18,15 +14,15 @@ const Comment: FC<PropsWithChildren<CommentProps>> = ({
<img className="h-8 w-8 rounded-full" src={Comment.User.profile} alt="" /> <img className="h-8 w-8 rounded-full" src={Comment.User.profile} alt="" />
</div> </div>
<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-sm">This is my comment</p>
<p className="text-xs text-gray-500">1 like</p> <p className="text-xs text-gray-500">1 like</p>
</div> </div>
</div> </div>
<HeartIcon className="block h-3 w-3" aria-hidden="true" /> <HeartIcon className="block h-3 w-3" aria-hidden="true" />
</div> </div>
) );
} };
export default Comment; export default Comment;
\ No newline at end of file
...@@ -86,7 +86,7 @@ const AnswerCard: FC<PropsWithChildren<AnswerCardProps>> = ({ ...@@ -86,7 +86,7 @@ const AnswerCard: FC<PropsWithChildren<AnswerCardProps>> = ({
{comments.length > 0 && ( {comments.length > 0 && (
<div> <div>
<p className="text-xs text-gray-500 hover:text-c-pink">View all 3 comments</p> <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> </div>
)} )}
{comments.length === 0 && ( {comments.length === 0 && (
......
...@@ -46,6 +46,7 @@ const Post: FC<PropsWithChildren<PostProps>> = ({ ...@@ -46,6 +46,7 @@ const Post: FC<PropsWithChildren<PostProps>> = ({
question={question} question={question}
rehydrateFeed={() => rehydrateFeed()} rehydrateFeed={() => rehydrateFeed()}
userList={userList} userList={userList}
commentLimit={1}
/> />
</div> </div>
</div> </div>
......
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment