Skip to content

Commit

Permalink
chore: add loading screen for showing resume pdf
Browse files Browse the repository at this point in the history
  • Loading branch information
adit-prawira committed Jan 26, 2024
1 parent 64fd3fc commit 63cf1ea
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/pages/Home/components/Bio/components/About/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState } from "react";
import { Page, Document, pdfjs } from "react-pdf";
import { Grid, Typography, Button } from "@mui/material";
import { Grid, Typography, Button, CircularProgress, Box } from "@mui/material";

import { OnDocumentLoadSuccess } from "react-pdf/dist/cjs/shared/types";
import { useModal } from "../../../../../../common/components/Modal";
Expand All @@ -19,7 +19,21 @@ export function About(): JSX.Element {
handleOpen({
title: "Resume",
content: (
<Document file="JobDocuments/resume.pdf" onLoadSuccess={handleLoad}>
<Document
file="JobDocuments/resume.pdf"
onLoadSuccess={handleLoad}
loading={
<Box
width="100%"
height={500}
justifyContent="center"
alignItems="center"
display="flex"
>
<CircularProgress size={300} color="primary" thickness={1} />
</Box>
}
>
<Page pageNumber={numPages} />
</Document>
),
Expand Down

0 comments on commit 63cf1ea

Please sign in to comment.