1- import {
2- ParentComponent ,
3- Show ,
4- children ,
5- Suspense ,
6- createEffect ,
7- } from "solid-js" ;
8- import { useCurrentPageData } from "@kobalte/solidbase/client" ;
9-
10- import { MainNavigation } from "~/ui/layout/main-navigation" ;
11- import { MainHeader } from "./layout/main-header" ;
12- import { Hero } from "./layout/hero" ;
13- import { cache , createAsync , useMatch } from "@solidjs/router" ;
14- import { DocsLayout } from "./docs-layout" ;
15- import { SidePanel } from "./layout/side-panel" ;
16- import { SUPPORTED_LOCALES } from "~/i18n/config" ;
17- import { getValidLocaleFromPathname } from "~/i18n/helpers" ;
1+ import { ParentComponent , Show , Suspense } from "solid-js" ;
182import {
193 coreTree ,
204 routerTree ,
@@ -26,6 +10,15 @@ import {
2610 metaEntries ,
2711} from "solid:collection" ;
2812import { PathMatch } from "@solidjs/router" ;
13+
14+ import { MainNavigation } from "~/ui/layout/main-navigation" ;
15+ import { MainHeader } from "./layout/main-header" ;
16+ import { Hero } from "./layout/hero" ;
17+ import { query , createAsync , useMatch } from "@solidjs/router" ;
18+ import { DocsLayout } from "./docs-layout" ;
19+ import { SidePanel } from "./layout/side-panel" ;
20+ import { SUPPORTED_LOCALES } from "~/i18n/config" ;
21+ import { getValidLocaleFromPathname } from "~/i18n/helpers" ;
2922import { useCurrentRouteMetaData } from "~/utils/route-metadata-helper" ;
3023
3124const PROJECTS = [ "solid-router" , "solid-start" , "solid-meta" ] as const ;
@@ -65,7 +58,7 @@ const getProjectFromUrl = (path: string) => {
6558 return null ;
6659} ;
6760
68- const getDocsMetadata = cache (
61+ const getDocsMetadata = query (
6962 async (
7063 isFirstMatch : PathMatch | undefined ,
7164 isI18nOrProject : PathMatch | undefined ,
@@ -139,10 +132,6 @@ export const Layout: ParentComponent<{ isError?: boolean }> = (props) => {
139132 { deferStream : true }
140133 ) ;
141134
142- const resolved = children ( ( ) => props . children ) ;
143- const sbPageData = useCurrentPageData ( ) ;
144- createEffect ( ( ) => console . log ( sbPageData ( ) ) ) ;
145-
146135 return (
147136 < div class = "relative dark:bg-slate-900 bg-slate-50" >
148137 < Show when = { entries ( ) } >
@@ -174,16 +163,16 @@ export const Layout: ParentComponent<{ isError?: boolean }> = (props) => {
174163 keyed
175164 fallback = {
176165 < article class = "px-2 md:px-10 expressive-code-overrides overflow-y-auto" >
177- { resolved ( ) }
166+ { props . children }
178167 </ article >
179168 }
180169 >
181- < Show when = { ! props . isError } fallback = { < > { resolved ( ) } </ > } >
170+ < Show when = { ! props . isError } fallback = { < > { props . children } </ > } >
182171 < Suspense >
183172 < Show when = { entries ( ) } >
184173 { ( data ) => (
185174 < DocsLayout entries = { data ( ) . entries } >
186- { resolved ( ) }
175+ { props . children }
187176 </ DocsLayout >
188177 ) }
189178 </ Show >
@@ -194,7 +183,7 @@ export const Layout: ParentComponent<{ isError?: boolean }> = (props) => {
194183 < Show when = { ! props . isError } >
195184 < div class = "hidden xl:block shrink-0 w-56 2xl:w-72 pr-4 prose prose-slate dark:prose-invert dark:text-slate-300" >
196185 < div class = "sticky top-[4.75rem] h-[calc(100vh-7rem)] overflow-y-auto custom-scrollbar" >
197- < SidePanel children = { resolved ( ) } />
186+ < SidePanel />
198187 </ div >
199188 </ div >
200189 </ Show >
0 commit comments