Add Dashboard route

This commit is contained in:
Florian Schroedl
2024-01-23 15:50:45 +01:00
parent 3e32a7b122
commit fdc9408666
3 changed files with 36 additions and 2 deletions

View File

@@ -7,6 +7,7 @@ import {
persistStorage,
} from "@/components/main/lib/state";
import { mergeDeepRight } from "ramda";
import { createBrowserRouter, RouterProvider } from "react-router-dom";
const STORAGE_KEY = "ecoplanet";
@@ -21,12 +22,23 @@ const App: React.FC = () => {
setState(mergeDeepRight(state, newState));
};
const router = createBrowserRouter([
{
path: "/",
element: <Dashboard state={state} updateState={updateState} />,
},
{
path: "/options",
element: <div>Hello world!</div>,
},
]);
return (
<div className="fixed top-0 right-0 bottom-0 left-0 flex">
<main className="flex grow flex-col">
<nav className="flex p-3 border-b border-solid border-slate-300"></nav>
<div className="flex grow items-center justify-center h-full w-full">
<Dashboard state={state} updateState={updateState} />
<div className="flex grow items-center justify-center h-full w-full bg-muted">
<RouterProvider router={router} />
</div>
</main>
</div>