Initial commit
This commit is contained in:
commit
864f37a652
48 changed files with 45596 additions and 0 deletions
33
app/client/pages/__root.tsx
Normal file
33
app/client/pages/__root.tsx
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import { Button, HStack, Stack } from "@chakra-ui/react";
|
||||
import { createRootRoute, Link, Outlet } from "@tanstack/react-router";
|
||||
import React from "react";
|
||||
|
||||
const TanStackRouterDevtools =
|
||||
process.env.NODE_ENV === "production"
|
||||
? () => null // Render nothing in production
|
||||
: React.lazy(() =>
|
||||
// Lazy load in development
|
||||
import("@tanstack/router-devtools").then((res) => ({
|
||||
default: res.TanStackRouterDevtools,
|
||||
// For Embedded Mode
|
||||
// default: res.TanStackRouterDevtoolsPanel
|
||||
})),
|
||||
);
|
||||
|
||||
export const Route = createRootRoute({
|
||||
component: () => (
|
||||
<Stack padding={3}>
|
||||
<HStack>
|
||||
<Link to="/">
|
||||
<Button>Home</Button>
|
||||
</Link>
|
||||
<Link to="/about">
|
||||
<Button>About</Button>
|
||||
</Link>
|
||||
</HStack>
|
||||
<hr style={{ padding: "4px" }} />
|
||||
<Outlet />
|
||||
<TanStackRouterDevtools />
|
||||
</Stack>
|
||||
),
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue