This commit is contained in:
Andrea 2024-11-05 22:06:28 +01:00
parent 68d05d529b
commit 54e7433a5c
Signed by: nullndr
GPG Key ID: 8DA8996EF89F33BB
3 changed files with 33 additions and 45 deletions

View File

@ -32,7 +32,7 @@ export const meta: MetaFunction = () => [
},
];
export default function App() {
export function Layout({ children }: React.PropsWithChildren) {
return (
<html lang="en">
<head>
@ -51,7 +51,7 @@ export default function App() {
/>
</head>
<Body>
<Outlet />
{children}
<ScrollRestoration />
<Scripts />
</Body>
@ -59,17 +59,15 @@ export default function App() {
);
}
export default function App() {
return <Outlet />;
}
export function ErrorBoundary() {
const error = useRouteError();
if (isRouteErrorResponse(error)) {
return (
<html lang="en">
<head>
<Meta />
<Links />
</head>
<Body>
<div className="flex flex-col items-center justify-around h-[100vh]">
<div>
<div className="text-center text-[#ffff00] text-[10vw] font-bold">
@ -83,18 +81,10 @@ export function ErrorBoundary() {
</div>
</div>
</div>
</Body>
</html>
);
}
return (
<html lang="en">
<head>
<Meta />
<Links />
</head>
<Body>
<div className="flex flex-col items-center justify-around h-[100vh]">
<div>
<div className="text-center text-[#ffff00] text-[6vw] font-bold">
@ -107,7 +97,5 @@ export function ErrorBoundary() {
</div>
</div>
</div>
</Body>
</html>
);
}

View File

@ -56,7 +56,7 @@ export default function Post() {
const MdxComponent = React.useMemo(() => getMDXComponent(code), [code]);
return (
<>
<div className="mx-2">
<header>
<Title>{title}</Title>
<span>
@ -92,6 +92,6 @@ export default function Post() {
</div>
</div>
</main>
</>
</div>
);
}

View File

@ -12,7 +12,7 @@ export default function Blog() {
const posts = useLoaderData<typeof loader>();
return (
<>
<div className="mx-2">
<LinkWrapper>
<Link to="/">Home</Link>
</LinkWrapper>
@ -22,6 +22,6 @@ export default function Blog() {
<PostPreview {...post} key={post.title} />
))}
</div>
</>
</div>
);
}