@@ -25,7 +25,7 @@ import type { SelectOption } from '~/components/Select'
2525import type { ConfigSchema , MenuItem } from '~/utils/config'
2626import { create } from 'zustand'
2727import { searchBoxParams , searchButtonParams } from '~/components/Orama'
28- import { Framework , getFrameworkOptions } from '~/libraries'
28+ import { Framework , getFrameworkOptions , getLibrary } from '~/libraries'
2929import { DocsCalloutQueryGG } from '~/components/DocsCalloutQueryGG'
3030import { DocsCalloutBytes } from '~/components/DocsCalloutBytes'
3131import { 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" >
0 commit comments