-
Notifications
You must be signed in to change notification settings - Fork 357
Expand file tree
/
Copy pathLayout.tsx
More file actions
25 lines (22 loc) · 790 Bytes
/
Layout.tsx
File metadata and controls
25 lines (22 loc) · 790 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { ErrorBoundary } from "solid-js";
import { Layout } from "./ui/layout";
import { NotFound } from "./ui/not-found";
import { SidebarProvider, useThemeListener } from "@kobalte/solidbase/client";
import { usePace } from "@kobalte/solidbase/default-theme/pace.js";
import { useRouteConfig } from "./utils";
import { OsmiumThemeStateProvider } from "./context";
import { ParentProps } from "solid-js";
export default function (props: ParentProps) {
const config = useRouteConfig();
useThemeListener();
usePace();
return (
<OsmiumThemeStateProvider>
<SidebarProvider config={config().themeConfig?.sidebar}>
<ErrorBoundary fallback={() => <NotFound />}>
<Layout>{props.children}</Layout>
</ErrorBoundary>
</SidebarProvider>
</OsmiumThemeStateProvider>
);
}