From 01b207e52fc68cb9c03de6fe72bb9086bf8fc929 Mon Sep 17 00:00:00 2001 From: Keane Chan Date: Thu, 27 Oct 2022 01:28:26 +0800 Subject: [PATCH] [resumes][feat] use primary buttons (#441) --- .../resumes/comments/ResumeCommentsList.tsx | 104 +++++++++--------- apps/portal/src/pages/resumes/[resumeId].tsx | 55 ++++----- apps/portal/src/pages/resumes/browse.tsx | 75 ++++++------- 3 files changed, 111 insertions(+), 123 deletions(-) diff --git a/apps/portal/src/components/resumes/comments/ResumeCommentsList.tsx b/apps/portal/src/components/resumes/comments/ResumeCommentsList.tsx index 3f3dc3c2..271fdd44 100644 --- a/apps/portal/src/components/resumes/comments/ResumeCommentsList.tsx +++ b/apps/portal/src/components/resumes/comments/ResumeCommentsList.tsx @@ -48,64 +48,64 @@ export default function ResumeCommentsList({ } }; + if (commentsQuery.isLoading) { + return ( +
+ +
+ ); + } + return ( -
- {commentsQuery.isLoading ? ( -
- -
- ) : ( -
- {RESUME_COMMENTS_SECTIONS.map(({ label, value }) => { - const comments = commentsQuery.data - ? commentsQuery.data.filter((comment: ResumeComment) => { - return (comment.section as string) === value; - }) - : []; - const commentCount = comments.length; +
+ {RESUME_COMMENTS_SECTIONS.map(({ label, value }) => { + const comments = commentsQuery.data + ? commentsQuery.data.filter((comment: ResumeComment) => { + return (comment.section as string) === value; + }) + : []; + const commentCount = comments.length; - return ( -
- {/* CommentHeader Section */} -
-
- {renderIcon(value)} + return ( +
+ {/* CommentHeader Section */} +
+
+ {renderIcon(value)} - {label} -
-
+ {label} +
+
- {/* Comment Section */} -
- {commentCount > 0 ? ( - comments.map((comment) => { - return ( - - ); - }) - ) : ( -
- + {/* Comment Section */} +
+ {commentCount > 0 ? ( + comments.map((comment) => { + return ( + + ); + }) + ) : ( +
+ -
- There are no comments for this section yet! -
-
- )} +
+ There are no comments for this section yet! +
-
- ); - })} -
- )} + )} +
+
+ ); + })}
); } diff --git a/apps/portal/src/pages/resumes/[resumeId].tsx b/apps/portal/src/pages/resumes/[resumeId].tsx index beb8c793..15d50e83 100644 --- a/apps/portal/src/pages/resumes/[resumeId].tsx +++ b/apps/portal/src/pages/resumes/[resumeId].tsx @@ -3,7 +3,7 @@ import formatDistanceToNow from 'date-fns/formatDistanceToNow'; import Error from 'next/error'; import Head from 'next/head'; import { useRouter } from 'next/router'; -import { signIn, useSession } from 'next-auth/react'; +import { useSession } from 'next-auth/react'; import { useState } from 'react'; import { AcademicCapIcon, @@ -142,24 +142,21 @@ export default function ResumeReviewPage() { const renderReviewButton = () => { if (session === null) { return ( -
- { - event.preventDefault(); - signIn(); - }}> - Sign in to join discussion - -
+ +
- Star + {detailsQuery.data?.stars.length ? 'Starred' : 'Star'} {detailsQuery.data?._count.stars} -
{renderReviewButton()}
@@ -326,21 +323,17 @@ export default function ResumeReviewPage() {
-
- -
+
-
- value === sortOrder) - ?.label - }> - {SORT_OPTIONS.map(({ label, value }) => ( - setSortOrder(value)}> - ))} - -
- -
- -
+
{isFetchingResumes ? (