wrappings
This commit is contained in:
@@ -1,6 +1,30 @@
|
||||
import { Title, Meta } from "@solidjs/meta";
|
||||
import { onMount, onCleanup } from "solid-js";
|
||||
|
||||
export default function Resume() {
|
||||
let iframeRef: HTMLIFrameElement | undefined;
|
||||
|
||||
onMount(() => {
|
||||
// Prevent iframe errors from bubbling up
|
||||
const handleError = (e: ErrorEvent) => {
|
||||
if (e.filename?.includes("resume.pdf") || e.message === "Script error.") {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
};
|
||||
|
||||
window.addEventListener("error", handleError, true);
|
||||
|
||||
onCleanup(() => {
|
||||
window.removeEventListener("error", handleError, true);
|
||||
|
||||
// Clear iframe source before unmount to prevent script errors
|
||||
if (iframeRef) {
|
||||
iframeRef.src = "about:blank";
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return (
|
||||
<>
|
||||
<Title>Resume | Michael Freno</Title>
|
||||
@@ -13,6 +37,7 @@ export default function Resume() {
|
||||
<Title>Resume - Freno.dev</Title>
|
||||
<div class="flex h-full w-full items-center justify-center">
|
||||
<iframe
|
||||
ref={iframeRef}
|
||||
src="/resume.pdf"
|
||||
class="h-full w-full border-0"
|
||||
title="Resume PDF"
|
||||
|
||||
Reference in New Issue
Block a user