feat: compose layout & page elements
This commit is contained in:
parent
67492651ed
commit
79b465abe6
@ -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>
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user