diff --git a/apps/portal/src/components/offers/profile/ProfileComments.tsx b/apps/portal/src/components/offers/profile/ProfileComments.tsx index 0eeaa1a3..a9357d92 100644 --- a/apps/portal/src/components/offers/profile/ProfileComments.tsx +++ b/apps/portal/src/components/offers/profile/ProfileComments.tsx @@ -186,7 +186,7 @@ export default function ProfileComments({ display="block" isLabelHidden={false} isLoading={createCommentMutation.isLoading} - label="Comment" + label="Submit" size="sm" variant="primary" onClick={() => handleComment(currentReply)} diff --git a/apps/portal/src/components/offers/profile/comments/CommentCard.tsx b/apps/portal/src/components/offers/profile/comments/CommentCard.tsx index b958d329..7c198d32 100644 --- a/apps/portal/src/components/offers/profile/comments/CommentCard.tsx +++ b/apps/portal/src/components/offers/profile/comments/CommentCard.tsx @@ -1,10 +1,10 @@ +import { formatDistanceToNow } from 'date-fns'; import { signIn, useSession } from 'next-auth/react'; import { useState } from 'react'; import { Button, Dialog, TextArea, useToast } from '@tih/ui'; import ProfilePhotoHolder from '~/components/offers/profile/ProfilePhotoHolder'; -import { timeSinceNow } from '~/utils/offers/time'; import { trpc } from '~/utils/trpc'; import type { Reply } from '~/types/offers'; @@ -135,45 +135,45 @@ export default function CommentCard({ )}
-
-

- {user?.name ?? 'unknown user'} +

+

+ {user?.name ?? 'Unknown user'}

+ · +
+ {formatDistanceToNow(createdAt, { + addSuffix: true, + })} +

{message}

-
- - {timeSinceNow(createdAt)} ago - {' '} - {replyLength > 0 && ( - <> - ·{' '} - - - )} +
{!disableReply && ( - <> - ·{' '} - - + + )} + {replyLength > 0 && ( + )} {deletable && ( <> - ·{' '}
{!disableReply && isReplying && ( -
+
{ event.preventDefault(); event.stopPropagation(); @@ -226,23 +227,29 @@ export default function CommentCard({ value={currentReply} onChange={(value) => setCurrentReply(value)} /> -
-
-
+
+
diff --git a/apps/portal/src/components/offers/profile/comments/ExpandableCommentCard.tsx b/apps/portal/src/components/offers/profile/comments/ExpandableCommentCard.tsx index 3f160016..d65ceac8 100644 --- a/apps/portal/src/components/offers/profile/comments/ExpandableCommentCard.tsx +++ b/apps/portal/src/components/offers/profile/comments/ExpandableCommentCard.tsx @@ -27,19 +27,21 @@ export default function ExpandableCommentCard({ token={token} /> {comment.replies && comment.replies.length > 0 && isExpanded && ( -
-
    - {comment.replies.map((reply) => ( -
  • - -
  • - ))} -
+
+
+
    + {comment.replies.map((reply) => ( +
  • + +
  • + ))} +
+
)}
diff --git a/apps/portal/src/components/resumes/comments/ResumeCommentListItem.tsx b/apps/portal/src/components/resumes/comments/ResumeCommentListItem.tsx index af749a63..7db38ac9 100644 --- a/apps/portal/src/components/resumes/comments/ResumeCommentListItem.tsx +++ b/apps/portal/src/components/resumes/comments/ResumeCommentListItem.tsx @@ -50,7 +50,7 @@ export default function ResumeCommentListItem({
{/* Name and creation time */}
-

+

{comment.user.name ?? 'Reviewer ABC'}

{isCommentOwner && ( @@ -83,64 +83,59 @@ export default function ResumeCommentListItem({ )} {/* Upvote and edit */} -
+
{/* Action buttons; only present for authenticated user when not editing/replying */} - {userId && !isEditingComment && !isReplyingComment && ( - <> - {isCommentOwner && ( - <> - ·{' '} - - - )} - {!comment.parentId && ( - <> - ·{' '} - - - )} - + {userId && !comment.parentId && ( + )} {comment.children.length > 0 && ( - <> - ·{' '} - - + + )} + {isCommentOwner && ( + )}
{/* Reply Form */} {isReplyingComment && ( - +
+ +
)} {/* Replies */} diff --git a/apps/portal/src/components/resumes/comments/comment/ResumeCommentEditForm.tsx b/apps/portal/src/components/resumes/comments/comment/ResumeCommentEditForm.tsx index 1d0a7bd7..ddfdb5df 100644 --- a/apps/portal/src/components/resumes/comments/comment/ResumeCommentEditForm.tsx +++ b/apps/portal/src/components/resumes/comments/comment/ResumeCommentEditForm.tsx @@ -67,39 +67,35 @@ export default function ResumeCommentEditForm({ }; return ( -
-
-