Add Dashboard route
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user