Skip to content

Commit

Permalink
fix pdf on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
martincham committed Dec 2, 2024
1 parent 3d565b3 commit fd57bad
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions src/pages/about/Resume.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
import React from "react";

const Resume: React.FC = () => {
const isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
const pdfUrl = "/files/MartinChamberlinResume.pdf";
return (
<div className="container mx-auto p-6 ">
<section className="container mx-auto py-2">
<iframe
src="/files/MartinChamberlinResume.pdf"
className="w-full h-screen"
style={{ border: "none" }}
title="Embedded Resume PDF"
></iframe>
{isMobile ? (
<a
href={pdfUrl}
target="_blank"
rel="noopener noreferrer"
className="text-blue-500 underline"
>
Download Resume
</a>
) : (
<iframe
src={pdfUrl}
className="w-full h-screen"
style={{ border: "none" }}
title="Embedded Resume PDF"
></iframe>
)}
</section>
</div>
);
Expand Down

0 comments on commit fd57bad

Please sign in to comment.