Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
adase11 committed Oct 6, 2024
1 parent 5257aa2 commit 52c8d09
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 20 deletions.
31 changes: 18 additions & 13 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Worker } from '@react-pdf-viewer/core';
import React, { Suspense } from 'react';
import { BrowserRouter, Route, Routes } from 'react-router-dom';
import Main from './layouts/Main';
Expand All @@ -17,19 +18,23 @@ const Resume = React.lazy(() => import('./pages/Resume'));
const Stats = React.lazy(() => import('./pages/Stats'));

const App = () => (
<BrowserRouter basename={PUBLIC_URL}>
<Suspense fallback={<Main />}>
<Routes>
<Route path="/" element={<Index />} />
<Route path="/about" element={<About />} />
<Route path="/projects" element={<Projects />} />
<Route path="/stats" element={<Stats />} />
<Route path="/contact" element={<Contact />} />
<Route path="/resume" element={<Resume />} />
<Route path="*" element={<NotFound />} />
</Routes>
</Suspense>
</BrowserRouter>
<Worker
workerUrl={`https://unpkg.com/[email protected]/build/pdf.worker.min.js`}
>
<BrowserRouter basename={PUBLIC_URL}>
<Suspense fallback={<Main />}>
<Routes>
<Route path="/" element={<Index />} />
<Route path="/about" element={<About />} />
<Route path="/projects" element={<Projects />} />
<Route path="/stats" element={<Stats />} />
<Route path="/contact" element={<Contact />} />
<Route path="/resume" element={<Resume />} />
<Route path="*" element={<NotFound />} />
</Routes>
</Suspense>
</BrowserRouter>
</Worker>
);

export default App;
8 changes: 2 additions & 6 deletions src/components/Projects/Pdf.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import { Viewer, Worker } from '@react-pdf-viewer/core';
import { Viewer } from '@react-pdf-viewer/core';
import '@react-pdf-viewer/core/lib/styles/index.css';
import React from 'react';

const PdfViewer = (path: string) => {
return (
<div style={{ height: '750px' }}>
<Worker
workerUrl={`https://unpkg.com/[email protected]/build/pdf.worker.min.js`}
>
<Viewer fileUrl={path} />
</Worker>
<Viewer fileUrl={path} />
</div>
);
};
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
},
"include": [
"./src/"
]
, "src/lib/pdf.worker.min.js" ]
}

0 comments on commit 52c8d09

Please sign in to comment.