|
|
@ -35,18 +35,18 @@ export default function ResumeReviewPage() {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
|
const starMutation = trpc.useMutation('resumes.resume.star', {
|
|
|
|
const starMutation = trpc.useMutation('resumes.resume.star', {
|
|
|
|
onError() {
|
|
|
|
onSuccess() {
|
|
|
|
setStarDetails({
|
|
|
|
setStarDetails({
|
|
|
|
isStarred: false,
|
|
|
|
isStarred: true,
|
|
|
|
numStars: starDetails.numStars - 1,
|
|
|
|
numStars: starDetails.numStars + 1,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
const unstarMutation = trpc.useMutation('resumes.resume.unstar', {
|
|
|
|
const unstarMutation = trpc.useMutation('resumes.resume.unstar', {
|
|
|
|
onError() {
|
|
|
|
onSuccess() {
|
|
|
|
setStarDetails({
|
|
|
|
setStarDetails({
|
|
|
|
isStarred: true,
|
|
|
|
isStarred: false,
|
|
|
|
numStars: starDetails.numStars + 1,
|
|
|
|
numStars: starDetails.numStars - 1,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -65,12 +65,11 @@ export default function ResumeReviewPage() {
|
|
|
|
}, [detailsQuery.data]);
|
|
|
|
}, [detailsQuery.data]);
|
|
|
|
|
|
|
|
|
|
|
|
const onStarButtonClick = () => {
|
|
|
|
const onStarButtonClick = () => {
|
|
|
|
setStarDetails({
|
|
|
|
if (session?.user?.id == null) {
|
|
|
|
isStarred: !starDetails.isStarred,
|
|
|
|
router.push('/api/auth/signin');
|
|
|
|
numStars: starDetails.isStarred
|
|
|
|
return;
|
|
|
|
? starDetails.numStars - 1
|
|
|
|
}
|
|
|
|
: starDetails.numStars + 1,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
// Star button only rendered if resume exists
|
|
|
|
// Star button only rendered if resume exists
|
|
|
|
// Star button only clickable if user exists
|
|
|
|
// Star button only clickable if user exists
|
|
|
|
if (starDetails.isStarred) {
|
|
|
|
if (starDetails.isStarred) {
|
|
|
@ -110,7 +109,7 @@ export default function ResumeReviewPage() {
|
|
|
|
: '',
|
|
|
|
: '',
|
|
|
|
'isolate inline-flex max-h-10 items-center space-x-4 rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 disabled:hover:bg-white',
|
|
|
|
'isolate inline-flex max-h-10 items-center space-x-4 rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 disabled:hover:bg-white',
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
disabled={session?.user === undefined}
|
|
|
|
disabled={starMutation.isLoading || unstarMutation.isLoading}
|
|
|
|
id="star-button"
|
|
|
|
id="star-button"
|
|
|
|
type="button"
|
|
|
|
type="button"
|
|
|
|
onClick={onStarButtonClick}>
|
|
|
|
onClick={onStarButtonClick}>
|
|
|
@ -166,7 +165,7 @@ export default function ResumeReviewPage() {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{detailsQuery.data.additionalInfo && (
|
|
|
|
{detailsQuery.data.additionalInfo && (
|
|
|
|
<div className="flex items-center pt-2 text-sm text-gray-500">
|
|
|
|
<div className="flex items-start whitespace-pre-wrap pt-2 text-sm text-gray-500">
|
|
|
|
<InformationCircleIcon
|
|
|
|
<InformationCircleIcon
|
|
|
|
aria-hidden="true"
|
|
|
|
aria-hidden="true"
|
|
|
|
className="mr-1.5 h-5 w-5 flex-shrink-0 text-gray-400"
|
|
|
|
className="mr-1.5 h-5 w-5 flex-shrink-0 text-gray-400"
|
|
|
|