From 22d5f54a47319ae1b35b7eb4302762776ab17291 Mon Sep 17 00:00:00 2001 From: Keane Chan Date: Fri, 21 Oct 2022 15:25:14 +0800 Subject: [PATCH] [resumes][feat] add padding and hide scrollbar for comments (#404) * [resumes][feat] add padding and hide scrollbar for comments * [resumes][feat] add findUserTopUpvotedCommentCount query --- .../resumes/badges/ResumeUserBadges.tsx | 7 +- .../resumes/comments/ResumeCommentsList.tsx | 3 +- .../router/resumes/resumes-resume-router.ts | 85 +++++++++++++++---- packages/tailwind-config/package.json | 1 + packages/tailwind-config/tailwind.config.js | 1 + yarn.lock | 5 ++ 6 files changed, 83 insertions(+), 19 deletions(-) diff --git a/apps/portal/src/components/resumes/badges/ResumeUserBadges.tsx b/apps/portal/src/components/resumes/badges/ResumeUserBadges.tsx index 3e6325c7..1622dd9e 100644 --- a/apps/portal/src/components/resumes/badges/ResumeUserBadges.tsx +++ b/apps/portal/src/components/resumes/badges/ResumeUserBadges.tsx @@ -17,12 +17,15 @@ export default function ResumeUserBadges({ userId }: Props) { 'resumes.resume.findUserMaxResumeUpvoteCount', { userId }, ]); + const userTopUpvotedCommentCountQuery = trpc.useQuery([ + 'resumes.resume.findUserTopUpvotedCommentCount', + { userId }, + ]); - // TODO: Add other badges in const payload: BadgePayload = { maxResumeUpvoteCount: userMaxResumeUpvoteCountQuery.data ?? 0, reviewedResumesCount: userReviewedResumeCountQuery.data ?? 0, - topUpvotedCommentCount: 20, + topUpvotedCommentCount: userTopUpvotedCommentCountQuery.data ?? 0, }; return ( diff --git a/apps/portal/src/components/resumes/comments/ResumeCommentsList.tsx b/apps/portal/src/components/resumes/comments/ResumeCommentsList.tsx index 2fe23335..bb13da81 100644 --- a/apps/portal/src/components/resumes/comments/ResumeCommentsList.tsx +++ b/apps/portal/src/components/resumes/comments/ResumeCommentsList.tsx @@ -56,6 +56,7 @@ export default function ResumeCommentsList({ } return (