mirror of
https://github.com/r-freeman/portfolio.git
synced 2025-04-11 20:54:31 +00:00
Update comment style
All checks were successful
Build And Publish / BuildAndPublish (push) Successful in 3m10s
All checks were successful
Build And Publish / BuildAndPublish (push) Successful in 3m10s
This commit is contained in:
parent
ad82326eb9
commit
907da404b2
@ -26,28 +26,32 @@ type CommentsListProps = {
|
||||
|
||||
Comments.List = function List({comments}: CommentsListProps) {
|
||||
return (
|
||||
<section>
|
||||
<h3 className="text-base font-semibold tracking-tight text-zinc-800 dark:text-zinc-100 mb-4">
|
||||
Comments
|
||||
</h3>
|
||||
{comments.map((comment) => (
|
||||
<article key={comment.id} className="flex gap-x-4 py-5">
|
||||
<Image src={comment.user.image} alt={comment.user.name} width={64} height={64}
|
||||
className="size-12 rounded-full"/>
|
||||
<div className="flex-auto">
|
||||
<div className="flex items-baseline gap-x-1">
|
||||
<p className="font-semibold text-sm text-zinc-800 dark:text-zinc-100">{comment.user.name}</p>
|
||||
<p className="text-sm text-zinc-500 dark:text-zinc-400">
|
||||
<time dateTime={comment.created_at}>
|
||||
<span>· {`${formatDistanceToNow(comment.created_at)} ago`}</span>
|
||||
</time>
|
||||
</p>
|
||||
</div>
|
||||
<p className="mt-1 text-sm text-zinc-600 dark:text-zinc-400">{comment.content}</p>
|
||||
</div>
|
||||
</article>
|
||||
))}
|
||||
</section>
|
||||
<>
|
||||
{comments.length > 0 &&
|
||||
<section>
|
||||
<h3 className="text-base font-semibold tracking-tight text-zinc-800 dark:text-zinc-100 mb-4">
|
||||
Comments
|
||||
</h3>
|
||||
{comments.map((comment) => (
|
||||
<article key={comment.id} className="flex gap-x-4 py-5">
|
||||
<Image src={comment.user.image} alt={comment.user.name} width={64} height={64}
|
||||
className="size-12 rounded-full"/>
|
||||
<div className="flex-auto">
|
||||
<div className="flex items-baseline gap-x-1">
|
||||
<p className="font-semibold text-sm text-zinc-800 dark:text-zinc-100">{comment.user.name}</p>
|
||||
<p className="text-sm text-zinc-500 dark:text-zinc-400">
|
||||
<time dateTime={comment.created_at}>
|
||||
<span>· {`${formatDistanceToNow(comment.created_at)} ago`}</span>
|
||||
</time>
|
||||
</p>
|
||||
</div>
|
||||
<p className="mt-1 text-sm text-zinc-600 dark:text-zinc-400 max-w-xl">{comment.content}</p>
|
||||
</div>
|
||||
</article>
|
||||
))}
|
||||
</section>
|
||||
}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user