From e6538a62a5b76d4bb2d6b506379f02c6ccc29fe7 Mon Sep 17 00:00:00 2001 From: Terence <45381509+Vielheim@users.noreply.github.com> Date: Thu, 27 Oct 2022 16:49:30 +0800 Subject: [PATCH] [resumes][refactor] Update app UI (#434) * [resumes][refactor] Update marketing page tabs * [resumes][feat] mobile responsive resume rows on browse * [resumes][fix] padding on pdf view in mobile * [resumes][chore] add uni years to labels Co-authored-by: Terence Ho <> Co-authored-by: peirong.wu --- .../src/components/resumes/ResumePdf.tsx | 43 ++++---- .../resumes/browse/ResumeListItem.tsx | 97 +++++++++++-------- .../resumes/landing/PrimaryFeatures.tsx | 5 +- apps/portal/src/pages/resumes/[resumeId].tsx | 21 ++-- apps/portal/src/pages/resumes/browse.tsx | 67 ++++++------- apps/portal/src/pages/resumes/index.tsx | 2 +- .../portal/src/utils/resumes/resumeFilters.ts | 13 +-- packages/ui/src/Pagination/Pagination.tsx | 4 +- 8 files changed, 133 insertions(+), 119 deletions(-) diff --git a/apps/portal/src/components/resumes/ResumePdf.tsx b/apps/portal/src/components/resumes/ResumePdf.tsx index 4a4c3a42..8caf0cb5 100644 --- a/apps/portal/src/components/resumes/ResumePdf.tsx +++ b/apps/portal/src/components/resumes/ResumePdf.tsx @@ -24,23 +24,18 @@ export default function ResumePdf({ url }: Props) { setNumPages(pdf.numPages); }; - useEffect(() => { - const onPageResize = () => { - setComponentWidth( - document.querySelector('#pdfView')?.getBoundingClientRect().width ?? - 780, - ); - }; - - window.addEventListener('resize', onPageResize); + const onPageResize = () => { + setComponentWidth( + document.querySelector('#pdfView')?.getBoundingClientRect().width ?? 780, + ); + }; - return () => { - window.removeEventListener('resize', onPageResize); - }; - }, []); + useEffect(() => { + onPageResize(); + }, [pageWidth]); return ( -
+
- {numPages > 1 && ( -
- setPageNumber(page)} - /> -
- )} +
+ setPageNumber(page)} + /> +
); } diff --git a/apps/portal/src/components/resumes/browse/ResumeListItem.tsx b/apps/portal/src/components/resumes/browse/ResumeListItem.tsx index eeeab21a..9db65f49 100644 --- a/apps/portal/src/components/resumes/browse/ResumeListItem.tsx +++ b/apps/portal/src/components/resumes/browse/ResumeListItem.tsx @@ -9,6 +9,18 @@ import { } from '@heroicons/react/20/solid'; import { ChatBubbleLeftIcon, StarIcon } from '@heroicons/react/24/outline'; +import type { + ExperienceFilter, + LocationFilter, + RoleFilter, +} from '~/utils/resumes/resumeFilters'; +import { + EXPERIENCES, + getFilterLabel, + LOCATIONS, + ROLES, +} from '~/utils/resumes/resumeFilters'; + import type { Resume } from '~/types/resume'; type Props = Readonly<{ @@ -19,52 +31,59 @@ type Props = Readonly<{ export default function ResumeListItem({ href, resumeInfo }: Props) { return ( -
-
- {resumeInfo.title} -
-
-