diff --git a/apps/portal/src/components/resumes/comments/ResumeCommentListItem.tsx b/apps/portal/src/components/resumes/comments/ResumeCommentListItem.tsx new file mode 100644 index 00000000..537f3fc2 --- /dev/null +++ b/apps/portal/src/components/resumes/comments/ResumeCommentListItem.tsx @@ -0,0 +1,77 @@ +import { + ArrowDownCircleIcon, + ArrowUpCircleIcon, +} from '@heroicons/react/20/solid'; +import { FaceSmileIcon } from '@heroicons/react/24/outline'; + +import ResumeExpandableText from '../shared/ResumeExpandableText'; + +import type { ResumeComment } from '~/types/resume-comments'; + +type ResumeCommentListItemProps = { + comment: ResumeComment; + userId?: string; +}; + +export default function ResumeCommentListItem({ + comment, + userId, +}: ResumeCommentListItemProps) { + const isCommentOwner = userId === comment.user.userId; + + return ( +
+
+ {comment.user.image ? ( + {comment.user.name + ) : ( + + )} + +
+ {/* Name and creation time */} +
+
+
+ {comment.user.name ?? 'Reviewer ABC'} +
+ +
+ {isCommentOwner ? '(Me)' : ''} +
+
+ +
+ {comment.createdAt.toLocaleString('en-US', { + dateStyle: 'medium', + timeStyle: 'short', + })} +
+
+ + {/* Description */} + {comment.description} + + {/* Upvote and edit */} +
+ {/* TODO: Implement upvote */} + +
{comment.numVotes}
+ + + {/* TODO: Implement edit */} + {isCommentOwner ? ( +
+ Edit +
+ ) : null} +
+
+
+
+ ); +} diff --git a/apps/portal/src/components/resumes/comments/ResumeCommentsList.tsx b/apps/portal/src/components/resumes/comments/ResumeCommentsList.tsx index 929f7571..5b50f0ad 100644 --- a/apps/portal/src/components/resumes/comments/ResumeCommentsList.tsx +++ b/apps/portal/src/components/resumes/comments/ResumeCommentsList.tsx @@ -5,8 +5,8 @@ import { Button } from '@tih/ui'; import { trpc } from '~/utils/trpc'; -import ResumeCommentListItem from './comment/ResumeCommentListItem'; import { RESUME_COMMENTS_SECTIONS } from './resumeCommentConstants'; +import ResumeCommentListItem from './ResumeCommentListItem'; import ResumeSignInButton from '../shared/ResumeSignInButton'; import type { ResumeComment } from '~/types/resume-comments'; diff --git a/apps/portal/src/components/resumes/comments/comment/ResumeCommentBody.tsx b/apps/portal/src/components/resumes/comments/comment/ResumeCommentBody.tsx deleted file mode 100644 index 51483bac..00000000 --- a/apps/portal/src/components/resumes/comments/comment/ResumeCommentBody.tsx +++ /dev/null @@ -1,73 +0,0 @@ -import { - ArrowDownCircleIcon, - ArrowUpCircleIcon, -} from '@heroicons/react/20/solid'; -import { FaceSmileIcon } from '@heroicons/react/24/outline'; - -import ResumeExpandableText from '../../shared/ResumeExpandableText'; - -import type { ResumeComment } from '~/types/resume-comments'; - -type ResumeCommentBodyProps = { - comment: ResumeComment; - isCommentOwner?: boolean; -}; - -export default function ResumeCommentBody({ - comment, - isCommentOwner, -}: ResumeCommentBodyProps) { - return ( -
- {comment.user.image ? ( - {comment.user.name - ) : ( - - )} - -
- {/* Name and creation time */} -
-
-
- {comment.user.name ?? 'Reviewer ABC'} -
- -
- {isCommentOwner ? '(Me)' : ''} -
-
- -
- {comment.createdAt.toLocaleString('en-US', { - dateStyle: 'medium', - timeStyle: 'short', - })} -
-
- - {/* Description */} - {comment.description} - - {/* Upvote and edit */} -
- {/* TODO: Implement upvote */} - -
{comment.numVotes}
- - - {/* TODO: Implement edit */} - {isCommentOwner ? ( -
- Edit -
- ) : null} -
-
-
- ); -} diff --git a/apps/portal/src/components/resumes/comments/comment/ResumeCommentCard.tsx b/apps/portal/src/components/resumes/comments/comment/ResumeCommentCard.tsx deleted file mode 100644 index ae9ac3bf..00000000 --- a/apps/portal/src/components/resumes/comments/comment/ResumeCommentCard.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import type { ReactNode } from 'react'; - -type ResumeCommentCardProps = { - children: ReactNode; -}; - -export default function ResumeCommentCard({ - children, -}: ResumeCommentCardProps) { - return ( -
- {children} -
- ); -} diff --git a/apps/portal/src/components/resumes/comments/comment/ResumeCommentListItem.tsx b/apps/portal/src/components/resumes/comments/comment/ResumeCommentListItem.tsx deleted file mode 100644 index 05172457..00000000 --- a/apps/portal/src/components/resumes/comments/comment/ResumeCommentListItem.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import ResumeCommentBody from './ResumeCommentBody'; -import ResumeCommentCard from './ResumeCommentCard'; - -import type { ResumeComment } from '~/types/resume-comments'; - -type ResumeCommentListItemProps = { - comment: ResumeComment; - userId?: string; -}; - -export default function ResumeCommentListItem({ - comment, - userId, -}: ResumeCommentListItemProps) { - const isCommentOwner = userId === comment.user.userId; - return ( - - - - ); -}