feat: compose layout & page elements

This commit is contained in:
p-sw 2024-05-31 21:11:48 +09:00
parent 67492651ed
commit 79b465abe6

View File

@ -4,13 +4,20 @@ import {
createRoutesFromElements, createRoutesFromElements,
RouterProvider, RouterProvider,
} from "react-router-dom"; } from "react-router-dom";
import SideNav from "./SideNav"; import MainLayout from "./MainLayout";
import Home from "./Home"; import Home from "./Home";
import DocsLayout from "./DocsLayout";
import ErrorBoundary from "./ErrorHandler";
import Introduction from "./docs/getting-started/introduction.mdx";
const router = createBrowserRouter( const router = createBrowserRouter(
createRoutesFromElements( createRoutesFromElements(
<Route path="/" element={<SideNav />}> <Route path="/" element={<MainLayout />} errorElement={<ErrorBoundary />}>
<Route index element={<Home />} /> <Route index element={<Home />} />
<Route path="/docs" element={<DocsLayout />}>
<Route index element={<Introduction />} />
</Route>
</Route> </Route>
) )
); );