From ce185607dbd101c0839b65631ef3c0ba60a91157 Mon Sep 17 00:00:00 2001 From: Keane Chan Date: Sun, 23 Oct 2022 01:00:23 +0800 Subject: [PATCH] [resumes][feat] use pagination component for resume pdf --- .../src/components/resumes/ResumePdf.tsx | 37 ++++++------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/apps/portal/src/components/resumes/ResumePdf.tsx b/apps/portal/src/components/resumes/ResumePdf.tsx index caa53063..18c53931 100644 --- a/apps/portal/src/components/resumes/ResumePdf.tsx +++ b/apps/portal/src/components/resumes/ResumePdf.tsx @@ -3,12 +3,10 @@ import { useEffect, useState } from 'react'; import { Document, Page, pdfjs } from 'react-pdf'; import type { PDFDocumentProxy } from 'react-pdf/node_modules/pdfjs-dist'; import { - ArrowLeftIcon, - ArrowRightIcon, MagnifyingGlassMinusIcon, MagnifyingGlassPlusIcon, } from '@heroicons/react/20/solid'; -import { Button, Spinner } from '@tih/ui'; +import { Button, Pagination, Spinner } from '@tih/ui'; pdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/build/pdf.worker.min.js`; @@ -86,28 +84,17 @@ export default function ResumePdf({ url }: Props) { - -
-
+ {numPages > 1 && ( +
+ setPageNumber(page)} + /> +
+ )} ); }