[resumes][refactor] tweak resume review page UI

pull/509/head
Yangshun Tay 2 years ago
parent 6d3c29e6c4
commit 762b55db4f

@ -194,7 +194,7 @@ export default function AppShell({ children }: Props) {
<span className="sr-only">Open sidebar</span> <span className="sr-only">Open sidebar</span>
<Bars3BottomLeftIcon aria-hidden="true" className="h-6 w-6" /> <Bars3BottomLeftIcon aria-hidden="true" className="h-6 w-6" />
</button> </button>
<div className="flex flex-1 justify-between px-4 sm:px-6"> <div className="flex flex-1 justify-between px-4 sm:px-6 lg:px-8">
<div className="flex flex-1 items-center"> <div className="flex flex-1 items-center">
<ProductNavigation <ProductNavigation
items={currentProductNavigation.navigation} items={currentProductNavigation.navigation}

@ -36,9 +36,9 @@ export default function ResumePdf({ url }: Props) {
return ( return (
<div className="w-full" id="pdfView"> <div className="w-full" id="pdfView">
<div className="group relative"> <div className="group relative bg-slate-100">
<Document <Document
className="flex h-[calc(100vh-16rem)] flex-row justify-center overflow-auto" className="flex h-[calc(100vh-16rem)] flex-row justify-center overflow-auto py-8"
file={url} file={url}
loading={<Spinner display="block" size="lg" />} loading={<Spinner display="block" size="lg" />}
noData="" noData=""
@ -79,7 +79,7 @@ export default function ResumePdf({ url }: Props) {
</div> </div>
</Document> </Document>
</div> </div>
<div className="flex justify-center p-4"> <div className="flex justify-center border-t border-slate-200 bg-white py-4">
<Pagination <Pagination
current={pageNumber} current={pageNumber}
end={numPages} end={numPages}

@ -39,18 +39,22 @@ export default function ResumeUserBadges({ userId }: Props) {
topUpvotedCommentCount: userTopUpvotedCommentCountQuery.data ?? 0, topUpvotedCommentCount: userTopUpvotedCommentCountQuery.data ?? 0,
}; };
const badges = RESUME_USER_BADGES.filter((badge) => badge.isValid(payload));
if (badges.length === 0) {
return null;
}
return ( return (
<div className="flex items-center justify-center gap-1"> <div className="flex items-center justify-center gap-1">
{RESUME_USER_BADGES.filter((badge) => badge.isValid(payload)).map( {badges.map((badge) => (
(badge) => (
<ResumeUserBadge <ResumeUserBadge
key={badge.id} key={badge.id}
description={badge.description} description={badge.description}
icon={badge.icon} icon={badge.icon}
title={badge.title} title={badge.title}
/> />
), ))}
)}
</div> </div>
); );
} }

@ -1,7 +1,6 @@
import clsx from 'clsx'; import clsx from 'clsx';
import { formatDistanceToNow } from 'date-fns'; import { formatDistanceToNow } from 'date-fns';
import { useState } from 'react'; import { useState } from 'react';
import { ChevronUpIcon } from '@heroicons/react/20/solid';
import { FaceSmileIcon } from '@heroicons/react/24/outline'; import { FaceSmileIcon } from '@heroicons/react/24/outline';
import ResumeCommentEditForm from './comment/ResumeCommentEditForm'; import ResumeCommentEditForm from './comment/ResumeCommentEditForm';
@ -12,10 +11,10 @@ import ResumeExpandableText from '../shared/ResumeExpandableText';
import type { ResumeComment } from '~/types/resume-comments'; import type { ResumeComment } from '~/types/resume-comments';
type ResumeCommentListItemProps = { type ResumeCommentListItemProps = Readonly<{
comment: ResumeComment; comment: ResumeComment;
userId: string | undefined; userId: string | undefined;
}; }>;
export default function ResumeCommentListItem({ export default function ResumeCommentListItem({
comment, comment,
@ -28,14 +27,14 @@ export default function ResumeCommentListItem({
return ( return (
<div className="min-w-fit"> <div className="min-w-fit">
<div className="flex flex-row space-x-2 p-1 align-top"> <div className="flex flex-row space-x-3 align-top">
{/* Image Icon */} {/* Image Icon */}
{comment.user.image ? ( {comment.user.image ? (
<img <img
alt={comment.user.name ?? 'Reviewer'} alt={comment.user.name ?? 'Reviewer'}
className={clsx( className={clsx(
'mt-1 rounded-full', 'mt-1 rounded-full',
comment.parentId ? 'h-6 w-6' : 'h-8 w-8 ', comment.parentId ? 'h-8 w-8' : 'h-10 w-10',
)} )}
src={comment.user.image!} src={comment.user.image!}
/> />
@ -50,24 +49,18 @@ export default function ResumeCommentListItem({
<div className="flex w-full flex-col space-y-1"> <div className="flex w-full flex-col space-y-1">
{/* Name and creation time */} {/* Name and creation time */}
<div className="flex flex-row justify-between"> <div className="flex flex-row items-center space-x-2">
<div className="flex flex-row items-center space-x-1"> <p className={clsx('text-sm font-medium text-slate-800')}>
<p
className={clsx(
'font-medium text-gray-800',
!!comment.parentId && 'text-sm',
)}>
{comment.user.name ?? 'Reviewer ABC'} {comment.user.name ?? 'Reviewer ABC'}
</p> </p>
{isCommentOwner && (
<p className="text-primary-800 text-xs font-medium"> <span className="bg-primary-100 text-primary-800 rounded-md py-0.5 px-1 text-xs">
{isCommentOwner ? '(Me)' : ''} Me
</p> </span>
)}
<ResumeUserBadges userId={comment.user.userId} /> <ResumeUserBadges userId={comment.user.userId} />
</div> <span className="font-medium text-slate-500">&middot;</span>
<div className="text-xs text-slate-500">
<div className="px-2 text-xs text-slate-600">
{formatDistanceToNow(comment.createdAt, { {formatDistanceToNow(comment.createdAt, {
addSuffix: true, addSuffix: true,
})} })}
@ -81,7 +74,7 @@ export default function ResumeCommentListItem({
setIsEditingComment={setIsEditingComment} setIsEditingComment={setIsEditingComment}
/> />
) : ( ) : (
<div className="text-gray-800"> <div className="text-slate-800">
<ResumeExpandableText <ResumeExpandableText
key={comment.description} key={comment.description}
text={comment.description} text={comment.description}
@ -90,56 +83,42 @@ export default function ResumeCommentListItem({
)} )}
{/* Upvote and edit */} {/* Upvote and edit */}
<div className="flex flex-row space-x-1 pt-1 align-middle"> <div className="flex flex-row space-x-2 pt-1 align-middle">
<ResumeCommentVoteButtons commentId={comment.id} userId={userId} /> <ResumeCommentVoteButtons commentId={comment.id} userId={userId} />
{/* Action buttons; only present for authenticated user when not editing/replying */} {/* Action buttons; only present for authenticated user when not editing/replying */}
{userId && !isEditingComment && !isReplyingComment && ( {userId && !isEditingComment && !isReplyingComment && (
<> <>
{isCommentOwner && ( {isCommentOwner && (
<>
<span className="font-medium text-slate-500">&middot;</span>{' '}
<button <button
className="text-primary-800 hover:text-primary-400 px-1 text-xs" className="px-1 text-xs font-medium text-slate-500 hover:text-slate-600"
type="button" type="button"
onClick={() => setIsEditingComment(true)}> onClick={() => setIsEditingComment(true)}>
Edit Edit
</button> </button>
</>
)} )}
{!comment.parentId && ( {!comment.parentId && (
<>
<span className="font-medium text-slate-500">&middot;</span>{' '}
<button <button
className="text-primary-800 hover:text-primary-400 px-1 text-xs" className="px-1 text-xs font-medium text-slate-500 hover:text-slate-600"
type="button" type="button"
onClick={() => setIsReplyingComment(true)}> onClick={() => setIsReplyingComment(true)}>
Reply Reply
</button> </button>
)}
</> </>
)} )}
</div> </>
{/* Reply Form */}
{isReplyingComment && (
<ResumeCommentReplyForm
parentId={comment.id}
resumeId={comment.resumeId}
section={comment.section}
setIsReplyingComment={setIsReplyingComment}
/>
)} )}
{/* Replies */}
{comment.children.length > 0 && ( {comment.children.length > 0 && (
<div className="min-w-fit space-y-1 pt-2"> <>
<span className="font-medium text-slate-500">&middot;</span>{' '}
<button <button
className="text-primary-800 hover:text-primary-300 flex items-center space-x-1 rounded-md text-xs font-medium" className="flex items-center space-x-1 rounded-md text-xs font-medium text-slate-500 hover:text-slate-600"
type="button" type="button"
onClick={() => setShowReplies(!showReplies)}> onClick={() => setShowReplies(!showReplies)}>
<ChevronUpIcon
className={clsx(
'h-5 w-5 ',
!showReplies && 'rotate-180 transform',
)}
/>
<span> <span>
{showReplies {showReplies
? `Hide ${ ? `Hide ${
@ -150,13 +129,24 @@ export default function ResumeCommentListItem({
}`} }`}
</span> </span>
</button> </button>
</>
{showReplies && ( )}
<div className="flex flex-row">
<div className="relative flex flex-col px-2 py-2">
<div className="flex-grow border-r border-slate-300" />
</div> </div>
{/* Reply Form */}
{isReplyingComment && (
<ResumeCommentReplyForm
parentId={comment.id}
resumeId={comment.resumeId}
section={comment.section}
setIsReplyingComment={setIsReplyingComment}
/>
)}
{/* Replies */}
{comment.children.length > 0 && showReplies && (
<div className="min-w-fit space-y-1 pt-2">
<div className="flex flex-row border-l-2 border-slate-200 pl-2">
<div className="flex flex-1 flex-col space-y-1"> <div className="flex flex-1 flex-col space-y-1">
{comment.children.map((child) => { {comment.children.map((child) => {
return ( return (
@ -169,7 +159,6 @@ export default function ResumeCommentListItem({
})} })}
</div> </div>
</div> </div>
)}
</div> </div>
)} )}
</div> </div>

@ -115,10 +115,12 @@ export default function ResumeCommentsForm({
}; };
return ( return (
<div className="h-[calc(100vh-13rem)] overflow-y-auto pb-4"> <div className="overflow-y-auto py-8 px-4 lg:h-[calc(100vh-13rem)]">
<h2 className="text-xl font-semibold text-slate-800">Add your review</h2> <h2 className="text-xl font-medium text-slate-800">
<p className="text-slate-800"> Contribute a review
Please fill in at least one section to submit your review </h2>
<p className="mt-1 text-slate-600">
Please fill in at least one section to submit a review.
</p> </p>
<form <form

@ -1,9 +1,7 @@
import clsx from 'clsx';
import { useSession } from 'next-auth/react'; import { useSession } from 'next-auth/react';
import { import {
BookOpenIcon, BookOpenIcon,
BriefcaseIcon, BriefcaseIcon,
ChatBubbleLeftRightIcon,
CodeBracketSquareIcon, CodeBracketSquareIcon,
FaceSmileIcon, FaceSmileIcon,
IdentificationIcon, IdentificationIcon,
@ -31,7 +29,7 @@ export default function ResumeCommentsList({
const commentsQuery = trpc.useQuery(['resumes.comments.list', { resumeId }]); const commentsQuery = trpc.useQuery(['resumes.comments.list', { resumeId }]);
const renderIcon = (section: ResumesSection) => { const renderIcon = (section: ResumesSection) => {
const className = 'h-7 w-7'; const className = 'h-5 w-5';
switch (section) { switch (section) {
case ResumesSection.GENERAL: case ResumesSection.GENERAL:
return <IdentificationIcon className={className} />; return <IdentificationIcon className={className} />;
@ -57,7 +55,7 @@ export default function ResumeCommentsList({
} }
return ( return (
<div className="flow-root w-full flex-col space-y-10 overflow-y-auto overflow-x-hidden lg:h-[calc(100vh-13rem)]"> <div className="flow-root w-full space-y-4 overflow-y-auto overflow-x-hidden px-4 lg:h-[calc(100vh-12rem)] lg:py-8">
{RESUME_COMMENTS_SECTIONS.map(({ label, value }) => { {RESUME_COMMENTS_SECTIONS.map(({ label, value }) => {
const comments = commentsQuery.data const comments = commentsQuery.data
? commentsQuery.data.filter((comment: ResumeComment) => { ? commentsQuery.data.filter((comment: ResumeComment) => {
@ -67,22 +65,19 @@ export default function ResumeCommentsList({
const commentCount = comments.length; const commentCount = comments.length;
return ( return (
<div key={value} className="space-y-4 pr-4"> <div
key={value}
className="rounded-lg border border-slate-200 bg-white shadow-sm">
{/* CommentHeader Section */} {/* CommentHeader Section */}
<div className="text-primary-800 flex items-center space-x-2"> <div className="flex items-center space-x-2 border-b border-slate-200 px-4 py-3 font-medium text-slate-700">
<hr className="flex-grow border-slate-800" />
{renderIcon(value)} {renderIcon(value)}
<span className="w-fit text-sm font-medium uppercase tracking-wide">
<span className="w-fit text-lg font-medium">{label}</span> {label}
<hr className="flex-grow border-slate-800" /> </span>
</div> </div>
{/* Comment Section */} {/* Comment Section */}
<div <div className="space-y-4 px-4 py-3">
className={clsx(
'space-y-2 rounded-md border-2 bg-white px-4 py-3 drop-shadow-md',
commentCount ? 'border-slate-300' : 'border-slate-300',
)}>
{commentCount > 0 ? ( {commentCount > 0 ? (
comments.map((comment) => { comments.map((comment) => {
return ( return (
@ -95,10 +90,8 @@ export default function ResumeCommentsList({
}) })
) : ( ) : (
<div className="flex flex-row items-center text-sm"> <div className="flex flex-row items-center text-sm">
<ChatBubbleLeftRightIcon className="mr-2 h-6 w-6 text-slate-500" />
<div className="text-slate-500"> <div className="text-slate-500">
There are no comments for this section yet! There are no comments for this section.
</div> </div>
</div> </div>
)} )}

@ -77,8 +77,7 @@ export default function ResumeCommentReplyForm({
}; };
return ( return (
<form onSubmit={handleSubmit(onSubmit)}> <form className="space-y-2" onSubmit={handleSubmit(onSubmit)}>
<div className="flex-column space-y-2 pt-2">
<TextArea <TextArea
{...(register('description', { {...(register('description', {
required: 'Reply cannot be empty!', required: 'Reply cannot be empty!',
@ -110,7 +109,6 @@ export default function ResumeCommentReplyForm({
variant="primary" variant="primary"
/> />
</div> </div>
</div>
</form> </form>
); );
} }

@ -1,10 +1,7 @@
import clsx from 'clsx'; import clsx from 'clsx';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import { useState } from 'react'; import { useState } from 'react';
import { import { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/solid';
ArrowDownCircleIcon,
ArrowUpCircleIcon,
} from '@heroicons/react/20/solid';
import { Vote } from '@prisma/client'; import { Vote } from '@prisma/client';
import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics'; import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics';
@ -92,8 +89,9 @@ export default function ResumeCommentVoteButtons({
}; };
return ( return (
<> <div className="flex items-center">
<button <button
className="-m-1 rounded-full p-1 hover:bg-slate-100"
disabled={ disabled={
commentVotesQuery.isLoading || commentVotesQuery.isLoading ||
commentVotesUpsertMutation.isLoading || commentVotesUpsertMutation.isLoading ||
@ -101,27 +99,36 @@ export default function ResumeCommentVoteButtons({
} }
type="button" type="button"
onClick={() => onVote(Vote.UPVOTE, setUpvoteAnimation)}> onClick={() => onVote(Vote.UPVOTE, setUpvoteAnimation)}>
<ArrowUpCircleIcon <ChevronUpIcon
className={clsx( className={clsx(
'h-4 w-4', 'h-5 w-5',
commentVotesQuery.data?.userVote?.value === Vote.UPVOTE || commentVotesQuery.data?.userVote?.value === Vote.UPVOTE ||
upvoteAnimation upvoteAnimation
? 'fill-primary-500' ? 'text-primary-500'
: 'fill-slate-400', : 'text-slate-400',
userId && userId &&
!downvoteAnimation && !downvoteAnimation &&
!upvoteAnimation && !upvoteAnimation &&
'hover:fill-primary-500', 'hover:text-primary-500',
upvoteAnimation && 'animate-[bounce_0.5s_infinite] cursor-default', upvoteAnimation && 'animate-[bounce_0.5s_infinite] cursor-default',
)} )}
/> />
</button> </button>
<div className="mx-1 flex min-w-[1rem] justify-center text-xs font-semibold text-gray-700">
<div className="flex min-w-[1rem] justify-center text-xs font-semibold text-gray-700">
{commentVotesQuery.data?.numVotes ?? 0} {commentVotesQuery.data?.numVotes ?? 0}
</div> </div>
<button <button
className={clsx(
'-m-1 rounded-full p-1 hover:bg-slate-100',
commentVotesQuery.data?.userVote?.value === Vote.DOWNVOTE ||
downvoteAnimation
? 'text-danger-500'
: 'text-slate-400',
userId &&
!downvoteAnimation &&
!upvoteAnimation &&
'hover:text-danger-500',
)}
disabled={ disabled={
commentVotesQuery.isLoading || commentVotesQuery.isLoading ||
commentVotesUpsertMutation.isLoading || commentVotesUpsertMutation.isLoading ||
@ -129,22 +136,14 @@ export default function ResumeCommentVoteButtons({
} }
type="button" type="button"
onClick={() => onVote(Vote.DOWNVOTE, setDownvoteAnimation)}> onClick={() => onVote(Vote.DOWNVOTE, setDownvoteAnimation)}>
<ArrowDownCircleIcon <ChevronDownIcon
className={clsx( className={clsx(
'h-4 w-4', 'h-5 w-5',
commentVotesQuery.data?.userVote?.value === Vote.DOWNVOTE ||
downvoteAnimation
? 'fill-danger-500'
: 'fill-slate-400',
userId &&
!downvoteAnimation &&
!upvoteAnimation &&
'hover:fill-danger-500',
downvoteAnimation && downvoteAnimation &&
'animate-[bounce_0.5s_infinite] cursor-default', 'animate-[bounce_0.5s_infinite] cursor-default',
)} )}
/> />
</button> </button>
</> </div>
); );
} }

@ -29,14 +29,14 @@ export default function ResumeExpandableText({
<span <span
ref={ref} ref={ref}
className={clsx( className={clsx(
'line-clamp-3 whitespace-pre-wrap text-sm', 'line-clamp-3 whitespace-pre-wrap text-xs sm:text-sm',
isExpanded ? 'line-clamp-none' : '', isExpanded ? 'line-clamp-none' : '',
)}> )}>
{text} {text}
</span> </span>
{descriptionOverflow && ( {descriptionOverflow && (
<p <p
className="text-primary-500 hover:text-primary-300 mt-1 cursor-pointer text-xs" className="text-primary-500 hover:text-primary-300 mt-1 cursor-pointer text-xs sm:text-sm"
onClick={onSeeActionClicked}> onClick={onSeeActionClicked}>
{isExpanded ? 'See Less' : 'See More'} {isExpanded ? 'See Less' : 'See More'}
</p> </p>

@ -180,10 +180,9 @@ export default function ResumeReviewPage() {
}; };
const renderReviewButton = () => { const renderReviewButton = () => {
if (session === null) { if (session == null) {
return ( return (
<Button <Button
className="h-10 shadow-md"
display="block" display="block"
href={loginPageHref()} href={loginPageHref()}
label="Log in to join discussion" label="Log in to join discussion"
@ -191,9 +190,9 @@ export default function ResumeReviewPage() {
/> />
); );
} }
return ( return (
<Button <Button
className="h-10 shadow-md"
display="block" display="block"
label="Add your review" label="Add your review"
variant="primary" variant="primary"
@ -224,36 +223,36 @@ export default function ResumeReviewPage() {
return ( return (
<> <>
{/* Has to strict quality check (===), don't change it to == */}
{(detailsQuery.isError || detailsQuery.data === null) && ErrorPage} {(detailsQuery.isError || detailsQuery.data === null) && ErrorPage}
{detailsQuery.isLoading && ( {detailsQuery.isLoading && (
<div className="w-full pt-4"> <div className="w-full pt-4">
{' '} <Spinner display="block" size="lg" />
<Spinner display="block" size="lg" />{' '}
</div> </div>
)} )}
{detailsQuery.isFetched && detailsQuery.data && ( {detailsQuery.isFetched && detailsQuery.data && (
<> <>
<Head> <Head>
<title>{detailsQuery.data.title}</title> <title>{`${detailsQuery.data.title} | Resume Review`}</title>
</Head> </Head>
<main className="h-full flex-1 space-y-2 py-4 px-8 xl:px-12 2xl:pr-16"> <main className="h-full w-full bg-white">
<div className="flex flex-wrap justify-between"> <div className="mx-auto space-y-4 border-b border-slate-200 px-4 py-6 sm:px-6 lg:space-y-2 lg:px-8">
<h1 className="w-[60%] pr-2 text-2xl font-semibold leading-7 text-slate-900"> <div className="flex flex-wrap justify-between space-y-4 lg:space-y-0">
<h1 className="pr-2 text-xl font-medium leading-7 text-slate-900 sm:text-2xl lg:w-[60%]">
{detailsQuery.data.title} {detailsQuery.data.title}
</h1> </h1>
<div className="flex gap-3 xl:pr-4"> <div className="flex gap-3">
{userIsOwner && ( {userIsOwner && (
<> <>
<Button <Button
addonPosition="start" addonPosition="start"
className="h-10 shadow-md"
icon={PencilSquareIcon} icon={PencilSquareIcon}
label="Edit" label="Edit"
variant="tertiary" variant="tertiary"
onClick={onEditButtonClick} onClick={onEditButtonClick}
/> />
<button <button
className="isolate inline-flex h-10 items-center space-x-4 rounded-md border border-slate-300 bg-white px-4 py-2 text-sm font-medium text-slate-700 shadow-md hover:bg-slate-50 focus:ring-slate-600 disabled:hover:bg-white" className="isolate inline-flex items-center space-x-4 rounded-md border border-slate-300 bg-white px-4 py-2 text-sm font-medium text-slate-700 hover:bg-slate-50 focus:ring-slate-600 disabled:hover:bg-white"
disabled={resolveMutation.isLoading} disabled={resolveMutation.isLoading}
type="button" type="button"
onClick={onResolveButtonClick}> onClick={onResolveButtonClick}>
@ -278,8 +277,10 @@ export default function ResumeReviewPage() {
</> </>
)} )}
<button <button
className="isolate inline-flex h-10 items-center space-x-4 rounded-md border border-slate-300 bg-white px-4 py-2 text-sm font-medium text-slate-700 shadow-md hover:bg-slate-50 focus:ring-slate-600 disabled:hover:bg-white" className="isolate inline-flex h-10 items-center space-x-4 rounded-md border border-slate-300 bg-white px-4 py-2 text-sm font-medium text-slate-700 hover:bg-slate-50 focus:ring-slate-600 disabled:hover:bg-white"
disabled={starMutation.isLoading || unstarMutation.isLoading} disabled={
starMutation.isLoading || unstarMutation.isLoading
}
type="button" type="button"
onClick={onStarButtonClick}> onClick={onStarButtonClick}>
<div className="-ml-1 mr-2 h-5 w-5"> <div className="-ml-1 mr-2 h-5 w-5">
@ -306,8 +307,9 @@ export default function ResumeReviewPage() {
<div className="hidden xl:block">{renderReviewButton()}</div> <div className="hidden xl:block">{renderReviewButton()}</div>
</div> </div>
</div> </div>
<div className="flex flex-col lg:mt-0 lg:flex-row lg:flex-wrap lg:space-x-8"> <div className="space-y-2">
<div className="mt-2 flex items-center text-sm text-slate-600 xl:mt-1"> <div className="grid grid-cols-2 gap-2 md:flex md:flex-wrap md:space-x-8">
<div className="col-span-1 flex items-center text-xs text-slate-600 sm:text-sm">
<BriefcaseIcon <BriefcaseIcon
aria-hidden="true" aria-hidden="true"
className="mr-1.5 h-5 w-5 flex-shrink-0 text-indigo-400" className="mr-1.5 h-5 w-5 flex-shrink-0 text-indigo-400"
@ -320,10 +322,13 @@ export default function ResumeReviewPage() {
roleLabel: detailsQuery.data?.role, roleLabel: detailsQuery.data?.role,
}) })
}> }>
{getFilterLabel(ROLES, detailsQuery.data.role as RoleFilter)} {getFilterLabel(
ROLES,
detailsQuery.data.role as RoleFilter,
)}
</button> </button>
</div> </div>
<div className="flex items-center pt-2 text-sm text-slate-600 xl:pt-1"> <div className="col-span-1 flex items-center text-xs text-slate-600 sm:text-sm">
<MapPinIcon <MapPinIcon
aria-hidden="true" aria-hidden="true"
className="mr-1.5 h-5 w-5 flex-shrink-0 text-indigo-400" className="mr-1.5 h-5 w-5 flex-shrink-0 text-indigo-400"
@ -342,7 +347,7 @@ export default function ResumeReviewPage() {
)} )}
</button> </button>
</div> </div>
<div className="flex items-center pt-2 text-sm text-slate-600 xl:pt-1"> <div className="col-span-1 flex items-center text-xs text-slate-600 sm:text-sm">
<AcademicCapIcon <AcademicCapIcon
aria-hidden="true" aria-hidden="true"
className="mr-1.5 h-5 w-5 flex-shrink-0 text-indigo-400" className="mr-1.5 h-5 w-5 flex-shrink-0 text-indigo-400"
@ -361,18 +366,21 @@ export default function ResumeReviewPage() {
)} )}
</button> </button>
</div> </div>
<div className="flex items-center pt-2 text-sm text-slate-600 xl:pt-1"> <div className="col-span-1 flex items-center text-xs text-slate-600 sm:text-sm">
<CalendarIcon <CalendarIcon
aria-hidden="true" aria-hidden="true"
className="mr-1.5 h-5 w-5 flex-shrink-0 text-indigo-400" className="mr-1.5 h-5 w-5 flex-shrink-0 text-indigo-400"
/> />
{`Uploaded ${formatDistanceToNow(detailsQuery.data.createdAt, { {`Uploaded ${formatDistanceToNow(
detailsQuery.data.createdAt,
{
addSuffix: true, addSuffix: true,
})} by ${detailsQuery.data.user.name}`} },
)} by ${detailsQuery.data.user.name}`}
</div> </div>
</div> </div>
{detailsQuery.data.additionalInfo && ( {detailsQuery.data.additionalInfo && (
<div className="flex items-start whitespace-pre-wrap pt-2 text-sm text-slate-600 xl:pt-1"> <div className="col-span-2 flex items-start whitespace-pre-wrap pt-2 text-slate-600 xl:pt-1">
<InformationCircleIcon <InformationCircleIcon
aria-hidden="true" aria-hidden="true"
className="mr-1.5 h-5 w-5 flex-shrink-0 text-indigo-400" className="mr-1.5 h-5 w-5 flex-shrink-0 text-indigo-400"
@ -383,23 +391,25 @@ export default function ResumeReviewPage() {
/> />
</div> </div>
)} )}
</div>
<div className="flex w-full flex-col gap-6 py-4 xl:flex-row xl:py-0"> </div>
<div className="w-full xl:w-1/2"> <div className="flex w-full flex-col divide-x divide-slate-200 lg:flex-row xl:py-0">
<div className="w-full bg-slate-100 lg:w-1/2">
<ResumePdf url={detailsQuery.data.url} /> <ResumePdf url={detailsQuery.data.url} />
</div> </div>
<div className="grow"> <div className="grow border-t border-slate-200 bg-slate-50 pb-4 lg:border-none lg:pb-0">
<div className="mb-6 space-y-4 xl:hidden"> <div className="divide-y divide-slate-200 lg:hidden">
<div className="bg-white p-4 lg:p-0">
{renderReviewButton()} {renderReviewButton()}
<div className="flex items-center space-x-2"> </div>
<hr className="flex-grow border-slate-300" /> {!showCommentsForm && (
<span className="bg-slate-50 px-3 text-lg font-medium text-slate-900"> <div className="p-4 lg:p-0">
<h2 className="text-xl font-medium text-slate-900">
Reviews Reviews
</span> </h2>
<hr className="flex-grow border-slate-300" />
</div> </div>
)}
</div> </div>
{showCommentsForm ? ( {showCommentsForm ? (
<ResumeCommentsForm <ResumeCommentsForm
resumeId={resumeId as string} resumeId={resumeId as string}

Loading…
Cancel
Save