Initial Commit
All checks were successful
Build and Push Docker Image / build (push) Successful in 3m6s
All checks were successful
Build and Push Docker Image / build (push) Successful in 3m6s
This commit is contained in:
51
src/routes/__root.tsx
Normal file
51
src/routes/__root.tsx
Normal file
@@ -0,0 +1,51 @@
|
||||
import {
|
||||
HeadContent,
|
||||
Outlet,
|
||||
Scripts,
|
||||
createRootRouteWithContext,
|
||||
} from "@tanstack/solid-router";
|
||||
import { TanStackRouterDevtools } from "@tanstack/solid-router-devtools";
|
||||
|
||||
import "@fontsource/inter/400.css";
|
||||
|
||||
import { HydrationScript } from "solid-js/web";
|
||||
import { Suspense } from "solid-js";
|
||||
|
||||
import styleCss from "~/styles.css?url";
|
||||
import Header from "~/components/Header";
|
||||
import { ThemeProvider } from "~/components/theme-provider";
|
||||
|
||||
export function ErrorComponent({ error }: { error: Error }) {
|
||||
console.log(error);
|
||||
return <div>Error: {error.message}</div>;
|
||||
}
|
||||
|
||||
export const Route = createRootRouteWithContext()({
|
||||
head: () => ({
|
||||
links: [{ rel: "stylesheet", href: styleCss }],
|
||||
}),
|
||||
shellComponent: RootComponent,
|
||||
errorComponent: ErrorComponent,
|
||||
});
|
||||
|
||||
function RootComponent() {
|
||||
return (
|
||||
<html>
|
||||
<head>
|
||||
<HydrationScript />
|
||||
<HeadContent />
|
||||
</head>
|
||||
<body>
|
||||
<Suspense>
|
||||
<ThemeProvider>
|
||||
<Header />
|
||||
<Outlet />
|
||||
</ThemeProvider>
|
||||
|
||||
<TanStackRouterDevtools />
|
||||
</Suspense>
|
||||
<Scripts />
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user