Skip to content

Commit a38fca8

Browse files
committed
fix: update lockfile
1 parent 404f227 commit a38fca8

17 files changed

+117
-49
lines changed

app/components/DocsLayout.tsx

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import type { SelectOption } from '~/components/Select'
2525
import type { ConfigSchema, MenuItem } from '~/utils/config'
2626
import { create } from 'zustand'
2727
import { searchBoxParams, searchButtonParams } from '~/components/Orama'
28-
import { Framework, getFrameworkOptions } from '~/libraries'
28+
import { Framework, getFrameworkOptions, getLibrary } from '~/libraries'
2929
import { DocsCalloutQueryGG } from '~/components/DocsCalloutQueryGG'
3030
import { DocsCalloutBytes } from '~/components/DocsCalloutBytes'
3131
import { ClientOnlySearchButton } from './ClientOnlySearchButton'
@@ -314,6 +314,10 @@ export function DocsLayout({
314314
repo,
315315
children,
316316
}: DocsLayoutProps) {
317+
const { libraryId } = useParams({
318+
strict: false,
319+
experimental_returnIntersection: true,
320+
})
317321
const frameworkConfig = useFrameworkConfig({ frameworks })
318322
const versionConfig = useVersionConfig({ versions })
319323
const menuConfig = useMenuConfig({ config, frameworks, repo })
@@ -419,18 +423,13 @@ export function DocsLayout({
419423
)
420424
})
421425

422-
const currentLibrary = useRouterState({
423-
select: (state) => {
424-
const library = state.location.pathname.split('/').at(1)
425-
return library ? library.charAt(0).toUpperCase() + library.slice(1) : ''
426-
},
427-
})
426+
const library = getLibrary(libraryId!)
428427

429428
const oramaSearchParams: SearchParamsFullText<AnyOrama, AnyDocument> = {
430429
threshold: 0,
431430
where: {
432431
category: {
433-
eq: currentLibrary,
432+
eq: libraryId,
434433
},
435434
},
436435
}
@@ -490,7 +489,14 @@ export function DocsLayout({
490489

491490
const largeMenu = (
492491
<div className="max-w-max w-full hidden lg:flex flex-col gap-4 h-screen sticky top-0 z-20">
493-
<div className="px-4 pt-4 flex gap-2 items-center text-2xl">{logo}</div>
492+
<div
493+
className="px-4 pt-4 flex gap-2 items-center text-2xl"
494+
style={{
495+
viewTransitionName: `library-name`,
496+
}}
497+
>
498+
{logo}
499+
</div>
494500
<div className="px-4">
495501
<ClientOnlySearchButton {...searchButtonParams} />
496502
</div>
@@ -574,7 +580,7 @@ export function DocsLayout({
574580
</div>
575581
</div>
576582
<div className="p-4 max-w-[240px] shrink-0 border-l border-gray-200 dark:border-white/10 hidden md:block">
577-
{currentLibrary === 'Query' ? (
583+
{libraryId === 'query' ? (
578584
<DocsCalloutQueryGG />
579585
) : (
580586
<DocsCalloutBytes />
@@ -583,7 +589,7 @@ export function DocsLayout({
583589
{showBytes ? (
584590
<div className="w-[300px] max-w-[350px] fixed md:hidden top-1/2 right-2 z-30 -translate-y-1/2 shadow-lg">
585591
<div className="bg-white dark:bg-gray-800 border border-black/10 dark:border-white/10 p-4 md:p-6 rounded-lg">
586-
{currentLibrary === 'Query' ? (
592+
{libraryId === 'query' ? (
587593
<DocsCalloutQueryGG />
588594
) : (
589595
<DocsCalloutBytes />
@@ -609,7 +615,7 @@ export function DocsLayout({
609615
className="origin-bottom-right -rotate-90 text-xs bg-white dark:bg-gray-800 border border-gray-100
610616
hover:bg-rose-600 hover:text-white p-1 px-2 rounded-t-md shadow-md dark:border-0"
611617
>
612-
{currentLibrary === 'Query' ? (
618+
{libraryId === 'query' ? (
613619
<>
614620
<strong>
615621
<span role="img" aria-label="crystal ball">

app/routes/$libraryId.$version.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ export const Route = createFileRoute('/$libraryId/$version')({
1111

1212
if (!library.availableVersions.concat('latest').includes(version!)) {
1313
throw redirect({
14-
params: {
14+
params: (prev) => ({
15+
...prev,
1516
version: 'latest',
16-
},
17+
}),
1718
})
1819
}
1920
},

app/routes/$libraryId.index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ export const Route = createFileRoute('/$libraryId/')({
44
loader: ({ params }) => {
55
throw redirect({
66
to: '/$libraryId/$version',
7-
params: {
7+
params: (prev) => ({
8+
...prev,
89
libraryId: params.libraryId,
910
version: 'latest',
10-
},
11+
}),
1112
})
1213
},
1314
})

app/routes/__root.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ export const Route = createRootRouteWithContext<{
130130
info={{
131131
componentStack: '',
132132
}}
133+
reset={() => {}}
133134
/>
134135
</RootDocument>
135136
)

app/routes/_libraries.config.$version.index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ export default function FormVersionIndex() {
120120
font-black text-4xl
121121
md:text-6xl
122122
lg:text-7xl`}
123+
style={{
124+
viewTransitionName: `library-name`,
125+
}}
123126
>
124127
<span className={gradientText}>TanStack Config</span>{' '}
125128
<span

app/routes/_libraries.form.$version.index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ export default function FormVersionIndex() {
126126
font-black text-4xl
127127
md:text-6xl
128128
lg:text-7xl`}
129+
style={{
130+
viewTransitionName: `library-name`,
131+
}}
129132
>
130133
<span className={gradientText}>TanStack Form</span>{' '}
131134
<span

app/routes/_libraries.query.$version.index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ export default function VersionIndex() {
134134
font-black text-4xl
135135
md:text-6xl
136136
lg:text-7xl`}
137+
style={{
138+
viewTransitionName: `library-name`,
139+
}}
137140
>
138141
<span className={gradientText}>TanStack Query</span>{' '}
139142
<span

app/routes/_libraries.ranger.$version.index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ export default function VersionIndex() {
128128
font-black text-4xl
129129
md:text-6xl
130130
lg:text-7xl`}
131+
style={{
132+
viewTransitionName: `library-name`,
133+
}}
131134
>
132135
<span className={gradientText}>TanStack Ranger</span>{' '}
133136
<span

app/routes/_libraries.router.$version.index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ function RouterVersionIndex() {
121121
font-black text-4xl
122122
md:text-6xl
123123
lg:text-7xl`}
124+
style={{
125+
viewTransitionName: `library-name`,
126+
}}
124127
>
125128
<span className={gradientText}>TanStack Router</span>
126129
</h1>

app/routes/_libraries.start.$version.index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ export default function VersionIndex() {
131131
font-black text-4xl
132132
md:text-6xl
133133
lg:text-7xl relative`}
134+
style={{
135+
viewTransitionName: `library-name`,
136+
}}
134137
>
135138
<span className={gradientText}>TanStack Start</span>
136139
</h1>
@@ -204,6 +207,7 @@ Check it out at https://tanstack.com/start/`
204207
)}`}
205208
target="_blank"
206209
className={`flex items-center gap-2 py-2 px-4 bg-cyan-500 rounded text-white uppercase font-extrabold`}
210+
rel="noreferrer"
207211
>
208212
<FaTwitter /> Tweet about it!
209213
</a>{' '}

0 commit comments

Comments
 (0)