Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyfallWasTaken committed Jan 12, 2025
1 parent 0de2f26 commit 292e196
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 68 deletions.
132 changes: 66 additions & 66 deletions frontend/app/root.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {
Links,
Meta,
Outlet,
Scripts,
ScrollRestoration,
isRouteErrorResponse,
Links,
Meta,
Outlet,
Scripts,
ScrollRestoration,
isRouteErrorResponse,
} from "react-router";
import type { Route } from "./+types/root";

Expand All @@ -13,77 +13,77 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import stylesheet from "./app.css?url";

export const links: Route.LinksFunction = () => [
{ rel: "preconnect", href: "https://fonts.googleapis.com" },
{
rel: "preconnect",
href: "https://fonts.gstatic.com",
crossOrigin: "anonymous",
},
{
rel: "stylesheet",
href: "https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap",
},
{ rel: "stylesheet", href: stylesheet },
{ rel: "preconnect", href: "https://fonts.googleapis.com" },
{
rel: "preconnect",
href: "https://fonts.gstatic.com",
crossOrigin: "anonymous",
},
{
rel: "stylesheet",
href: "https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap",
},
{ rel: "stylesheet", href: stylesheet },
];

const queryClient = new QueryClient();

export function Layout({ children }: { children: React.ReactNode }) {
return (
<html lang="en" className="dark">
<head>
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<Meta />
<Links />
{import.meta.env.VITE_UMAMI_SCRIPT && (
<script
defer
data-website-id={import.meta.env.VITE_UMAMI_WEBSITE_ID}
src={import.meta.env.VITE_UMAMI_SCRIPT}
/>
)}
</head>
<body className="bg-base text-text">
<QueryClientProvider client={queryClient}>
{children}
<ScrollRestoration />
<Scripts />
</QueryClientProvider>
</body>
</html>
);
return (
<html lang="en" className="dark">
<head>
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<Meta />
<Links />
{import.meta.env.VITE_UMAMI_SCRIPT && (
<script
defer
data-website-id={import.meta.env.VITE_UMAMI_WEBSITE_ID}
src={import.meta.env.VITE_UMAMI_SCRIPT}
/>
)}
</head>
<body className="bg-base text-text">
<QueryClientProvider client={queryClient}>
{children}
<ScrollRestoration />
<Scripts />
</QueryClientProvider>
</body>
</html>
);
}

export default function App() {
return <Outlet />;
return <Outlet />;
}

export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
let message = "Oops!";
let details = "An unexpected error occurred.";
let stack: string | undefined;
let message = "Oops!";
let details = "An unexpected error occurred.";
let stack: string | undefined;

if (isRouteErrorResponse(error)) {
message = error.status === 404 ? "404" : "Error";
details =
error.status === 404
? "The requested page could not be found."
: error.statusText || details;
} else if (import.meta.env.DEV && error && error instanceof Error) {
details = error.message;
stack = error.stack;
}
if (isRouteErrorResponse(error)) {
message = error.status === 404 ? "404" : "Error";
details =
error.status === 404
? "The requested page could not be found."
: error.statusText || details;
} else if (import.meta.env.DEV && error && error instanceof Error) {
details = error.message;
stack = error.stack;
}

return (
<main className="pt-16 p-4 container mx-auto">
<h1>{message}</h1>
<p>{details}</p>
{stack && (
<pre className="w-full p-4 overflow-x-auto">
<code>{stack}</code>
</pre>
)}
</main>
);
return (
<main className="pt-16 p-4 container mx-auto">
<h1>{message}</h1>
<p>{details}</p>
{stack && (
<pre className="w-full p-4 overflow-x-auto">
<code>{stack}</code>
</pre>
)}
</main>
);
}
4 changes: 2 additions & 2 deletions frontend/react-router.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Config } from "@react-router/dev/config";

export default {
// Vercel doesn't support SSR :skull:
ssr: false,
// Vercel doesn't support SSR :skull:
ssr: false,
} satisfies Config;

0 comments on commit 292e196

Please sign in to comment.