|
|
@ -3,7 +3,7 @@ import formatDistanceToNow from 'date-fns/formatDistanceToNow';
|
|
|
|
import Error from 'next/error';
|
|
|
|
import Error from 'next/error';
|
|
|
|
import Head from 'next/head';
|
|
|
|
import Head from 'next/head';
|
|
|
|
import { useRouter } from 'next/router';
|
|
|
|
import { useRouter } from 'next/router';
|
|
|
|
import { signIn, useSession } from 'next-auth/react';
|
|
|
|
import { useSession } from 'next-auth/react';
|
|
|
|
import { useState } from 'react';
|
|
|
|
import { useState } from 'react';
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
AcademicCapIcon,
|
|
|
|
AcademicCapIcon,
|
|
|
@ -142,24 +142,21 @@ export default function ResumeReviewPage() {
|
|
|
|
const renderReviewButton = () => {
|
|
|
|
const renderReviewButton = () => {
|
|
|
|
if (session === null) {
|
|
|
|
if (session === null) {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className=" flex h-10 justify-center rounded-md border border-slate-300 bg-white px-4 py-2 text-sm font-[400] hover:cursor-pointer hover:bg-slate-50">
|
|
|
|
<Button
|
|
|
|
<a
|
|
|
|
className="h-10 shadow-md"
|
|
|
|
href="/api/auth/signin"
|
|
|
|
display="block"
|
|
|
|
onClick={(event) => {
|
|
|
|
href="/api/auth/signin"
|
|
|
|
event.preventDefault();
|
|
|
|
label="Sign in to join discussion"
|
|
|
|
signIn();
|
|
|
|
variant="primary"
|
|
|
|
}}>
|
|
|
|
/>
|
|
|
|
Sign in to join discussion
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
|
className="h-10 py-2 shadow-md"
|
|
|
|
className="h-10 shadow-md"
|
|
|
|
display="block"
|
|
|
|
display="block"
|
|
|
|
label="Add your review"
|
|
|
|
label="Add your review"
|
|
|
|
variant="tertiary"
|
|
|
|
variant="primary"
|
|
|
|
onClick={() => setShowCommentsForm(true)}
|
|
|
|
onClick={() => setShowCommentsForm(true)}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -209,14 +206,15 @@ export default function ResumeReviewPage() {
|
|
|
|
</h1>
|
|
|
|
</h1>
|
|
|
|
<div className="flex gap-3 xl:pr-4">
|
|
|
|
<div className="flex gap-3 xl:pr-4">
|
|
|
|
{userIsOwner && (
|
|
|
|
{userIsOwner && (
|
|
|
|
<button
|
|
|
|
<Button
|
|
|
|
className="h-10 rounded-md border border-slate-300 bg-white py-1 px-2 text-center shadow-md hover:bg-slate-50"
|
|
|
|
addonPosition="start"
|
|
|
|
type="button"
|
|
|
|
className="h-10 shadow-md"
|
|
|
|
onClick={onEditButtonClick}>
|
|
|
|
icon={PencilSquareIcon}
|
|
|
|
<PencilSquareIcon className="text-primary-600 h-6 w-6" />
|
|
|
|
label="Edit"
|
|
|
|
</button>
|
|
|
|
variant="tertiary"
|
|
|
|
|
|
|
|
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 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 shadow-md hover:bg-slate-50 disabled:hover:bg-white"
|
|
|
|
disabled={starMutation.isLoading || unstarMutation.isLoading}
|
|
|
|
disabled={starMutation.isLoading || unstarMutation.isLoading}
|
|
|
@ -239,13 +237,12 @@ export default function ResumeReviewPage() {
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
Star
|
|
|
|
{detailsQuery.data?.stars.length ? 'Starred' : 'Star'}
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
<span className="relative -ml-px inline-flex">
|
|
|
|
<span className="relative -ml-px inline-flex">
|
|
|
|
{detailsQuery.data?._count.stars}
|
|
|
|
{detailsQuery.data?._count.stars}
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</button>
|
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
|
|
<div className="hidden xl:block">{renderReviewButton()}</div>
|
|
|
|
<div className="hidden xl:block">{renderReviewButton()}</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -326,21 +323,17 @@ export default function ResumeReviewPage() {
|
|
|
|
<ResumePdf url={detailsQuery.data.url} />
|
|
|
|
<ResumePdf url={detailsQuery.data.url} />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="grow">
|
|
|
|
<div className="grow">
|
|
|
|
<div className="relative p-2 xl:hidden">
|
|
|
|
<div className="mb-6 space-y-4 xl:hidden">
|
|
|
|
<div
|
|
|
|
{renderReviewButton()}
|
|
|
|
aria-hidden="true"
|
|
|
|
<div className="flex items-center space-x-2">
|
|
|
|
className="absolute inset-0 flex items-center">
|
|
|
|
<hr className="flex-grow border-slate-300" />
|
|
|
|
<div className="w-full border-t border-slate-300" />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className="relative flex justify-center">
|
|
|
|
|
|
|
|
<span className="bg-slate-50 px-3 text-lg font-medium text-slate-900">
|
|
|
|
<span className="bg-slate-50 px-3 text-lg font-medium text-slate-900">
|
|
|
|
Reviews
|
|
|
|
Reviews
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<hr className="flex-grow border-slate-300" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div className="mb-4 xl:hidden">{renderReviewButton()}</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{showCommentsForm ? (
|
|
|
|
{showCommentsForm ? (
|
|
|
|
<ResumeCommentsForm
|
|
|
|
<ResumeCommentsForm
|
|
|
|
resumeId={resumeId as string}
|
|
|
|
resumeId={resumeId as string}
|
|
|
|