1- import {
2- useMatch ,
3- Link ,
4- notFound ,
5- createFileRoute ,
6- } from '@tanstack/react-router'
7- import { DocsLayout } from '~/components/DocsLayout'
1+ import { Link , notFound , createFileRoute } from '@tanstack/react-router'
82import { findLibrary } from '~/libraries'
93import type { LibraryId } from '~/libraries'
104import { seo } from '~/utils/seo'
115
126import { Button } from '~/ui'
13- import { ConfigSchema } from '~/utils/config'
147import { landingComponents } from './$version'
158
169export const Route = createFileRoute ( '/$libraryId/$version/' ) ( {
@@ -41,26 +34,13 @@ function LibraryVersionIndex() {
4134 if ( ! library ) {
4235 throw notFound ( )
4336 }
44- const versionMatch = useMatch ( { from : '/$libraryId/$version' } )
45- const { config } = versionMatch . loaderData as { config : ConfigSchema }
4637
4738 const LandingComponent = landingComponents [ libraryId as LibraryId ]
4839
4940 if ( ! LandingComponent ) {
5041 return (
51- < DocsLayout
52- name = { library . name . replace ( 'TanStack ' , '' ) }
53- version = { version === 'latest' ? library . latestVersion : version ! }
54- colorFrom = { library . accentColorFrom ?? library . colorFrom }
55- colorTo = { library . accentColorTo ?? library . colorTo }
56- textColor = { library . accentTextColor ?? library . textColor ?? '' }
57- config = { config }
58- frameworks = { library . frameworks }
59- versions = { library . availableVersions }
60- repo = { library . repo }
61- isLandingPage
62- >
63- < div className = "flex flex-col items-center justify-center min-h-[50vh] gap-4" >
42+ < div className = "px-4 pt-32 pb-24" >
43+ < div className = "flex flex-col items-center justify-center min-h-[50vh] gap-4 max-w-3xl mx-auto text-center" >
6444 < h1 className = "text-2xl font-bold" > { library . name } </ h1 >
6545 < p className = "text-gray-600" > { library . description } </ p >
6646 < Button
@@ -71,24 +51,9 @@ function LibraryVersionIndex() {
7151 View Documentation
7252 </ Button >
7353 </ div >
74- </ DocsLayout >
54+ </ div >
7555 )
7656 }
7757
78- return (
79- < DocsLayout
80- name = { library . name . replace ( 'TanStack ' , '' ) }
81- version = { version === 'latest' ? library . latestVersion : version ! }
82- colorFrom = { library . accentColorFrom ?? library . colorFrom }
83- colorTo = { library . accentColorTo ?? library . colorTo }
84- textColor = { library . accentTextColor ?? library . textColor ?? '' }
85- config = { config }
86- frameworks = { library . frameworks }
87- versions = { library . availableVersions }
88- repo = { library . repo }
89- isLandingPage
90- >
91- < LandingComponent />
92- </ DocsLayout >
93- )
58+ return < LandingComponent />
9459}
0 commit comments