-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #123 from sora32127/comment_feed
コメントフィードページの追加
- Loading branch information
Showing
8 changed files
with
697 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import type{ CommentShowCardData } from "~/modules/db.server"; | ||
import CommentShowCard from "./CommentShowCard"; | ||
import { H2 } from "./Headings"; | ||
|
||
type CommentSectionProps = { | ||
title: string; | ||
comments: CommentShowCardData[]; | ||
children?: React.ReactNode; | ||
}; | ||
|
||
export default function CommentSection({ title, comments, children }: CommentSectionProps) { | ||
return ( | ||
<section className="recent-comments"> | ||
<H2>{title}</H2> | ||
<div className="grid grid-cols-1 md:grid-cols-3 gap-4"> | ||
{comments.map((comment) => ( | ||
<CommentShowCard | ||
key={comment.commentId} | ||
commentId={comment.commentId} | ||
commentContent={comment.commentContent} | ||
commentDateGmt={comment.commentDateGmt} | ||
commentAuthor={comment.commentAuthor} | ||
postId={comment.postId} | ||
postTitle={comment.postTitle} | ||
countLikes={comment.countLikes} | ||
countDislikes={comment.countDislikes} | ||
/> | ||
))} | ||
</div> | ||
{children} | ||
</section> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import type { PostCardData } from "~/modules/db.server"; | ||
import { H2 } from "./Headings"; | ||
import PostCard from "./PostCard"; | ||
|
||
type PostSectionProps = { | ||
title: string; | ||
posts: PostCardData[]; | ||
identifier: string; | ||
children?: React.ReactNode; | ||
}; | ||
|
||
export default function PostSection({ title, posts, identifier, children }: PostSectionProps) { | ||
return ( | ||
<section className={`${identifier}-posts`}> | ||
<H2>{title}</H2> | ||
<div className="grid grid-cols-1 md:grid-cols-3 gap-4"> | ||
{posts.map((post) => ( | ||
<PostCard | ||
key={`${identifier}-${post.postId}`} | ||
postId={post.postId} | ||
postTitle={post.postTitle} | ||
postDateGmt={post.postDateGmt.toString()} | ||
tagNames={post.tags.map((tag) => tag.tagName)} | ||
countLikes={post.countLikes} | ||
countDislikes={post.countDislikes} | ||
countComments={post.countComments} | ||
identifier={identifier} | ||
/> | ||
))} | ||
</div> | ||
{children} | ||
</section> | ||
); | ||
} |
Oops, something went wrong.
3cfe6f0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
healthy-person-emulator-dotorg-kmxg – ./
healthy-person-emulator-dotorg-k-git-12b613-sora32127s-projects.vercel.app
healthy-person-emulator-dotorg.vercel.app
healthy-person-emulator.org
healthy-person-emulator-dotorg-kmxg-sora32127s-projects.vercel.app