@@ -501,7 +501,7 @@ export default function TopBar() {
501501 } ;
502502
503503 return (
504- < header className = "w-full bg-background border-b border-border" >
504+ < div className = "w-full bg-background border-b border-border" >
505505 < div className = "flex items-center justify-between h-12 px-4" >
506506 { /* Left: Logo + Navigation */ }
507507 < div className = "flex items-center gap-4" >
@@ -520,78 +520,80 @@ export default function TopBar() {
520520 />
521521 </ Link >
522522
523- { /* Desktop Navigation */ }
524- < NavigationMenu className = "hidden lg:flex" >
525- < NavigationMenuList className = "flex gap-3" >
526- { navItems . map ( ( item ) => {
527- const normalizedPathname = pathname . replace ( / \/ $ / , "" ) || "/" ;
528- const normalizedHref = item . href . replace ( / \/ $ / , "" ) || "/" ;
529- let isActive =
530- normalizedPathname === normalizedHref ||
531- ( normalizedHref !== "/" &&
532- normalizedPathname . startsWith ( `${ normalizedHref } /` ) ) ||
533- clickedHref === item . href ;
534-
535- // Special handling for registry pages
536- if ( pathname . startsWith ( "/registry/" ) ) {
537- const segments = pathname . split ( "/" ) . filter ( Boolean ) ;
538- const itemName = segments [ segments . length - 1 ] ;
539-
540- if ( itemName ) {
541- const registryItem = getRegistryItem ( itemName ) ;
542-
543- if ( registryItem ) {
544- // If this is a UI component and we're checking "Primitives"
545- if (
546- item . name === "Primitives" &&
547- registryItem . type === "registry:ui"
548- ) {
549- isActive = true ;
550- }
551- // If this is a block/component and we're checking "Bloks"
552- else if (
553- item . name === "Bloks" &&
554- ( registryItem . type === "registry:block" ||
555- registryItem . type === "registry:component" )
556- ) {
557- isActive = true ;
523+ { /* Top navigation */ }
524+ < nav aria-label = "Top navigation" >
525+ < NavigationMenu className = "hidden lg:flex" >
526+ < NavigationMenuList className = "flex gap-3" >
527+ { navItems . map ( ( item ) => {
528+ const normalizedPathname = pathname . replace ( / \/ $ / , "" ) || "/" ;
529+ const normalizedHref = item . href . replace ( / \/ $ / , "" ) || "/" ;
530+ let isActive =
531+ normalizedPathname === normalizedHref ||
532+ ( normalizedHref !== "/" &&
533+ normalizedPathname . startsWith ( `${ normalizedHref } /` ) ) ||
534+ clickedHref === item . href ;
535+
536+ // Special handling for registry pages
537+ if ( pathname . startsWith ( "/registry/" ) ) {
538+ const segments = pathname . split ( "/" ) . filter ( Boolean ) ;
539+ const itemName = segments [ segments . length - 1 ] ;
540+
541+ if ( itemName ) {
542+ const registryItem = getRegistryItem ( itemName ) ;
543+
544+ if ( registryItem ) {
545+ // If this is a UI component and we're checking "Primitives"
546+ if (
547+ item . name === "Primitives" &&
548+ registryItem . type === "registry:ui"
549+ ) {
550+ isActive = true ;
551+ }
552+ // If this is a block/component and we're checking "Bloks"
553+ else if (
554+ item . name === "Bloks" &&
555+ ( registryItem . type === "registry:block" ||
556+ registryItem . type === "registry:component" )
557+ ) {
558+ isActive = true ;
559+ }
558560 }
559561 }
560562 }
561- }
562563
563- return (
564- < NavigationMenuItem key = { item . name } >
565- < Link
566- href = { item . href }
567- onClick = { ( ) => {
568- setClickedHref ( item . href ) ;
569- track ( TELEMETRY_EVENTS . topbar_nav_click , {
570- link : item . href ,
571- label : item . name ,
572- is_mobile : false ,
573- } ) ;
574- } }
575- className = { `${ navigationMenuTriggerStyle ( ) } ${
576- isActive ? "active" : ""
577- } `}
578- >
579- { item . name }
580- </ Link >
581- </ NavigationMenuItem >
582- ) ;
583- } ) }
584- </ NavigationMenuList >
585- </ NavigationMenu >
586-
587- { /* Mobile Nav Dropdown — client-only Radix to avoid hydration id drift */ }
588- < div className = "lg:hidden" >
589- < MobileNavDropdown
590- pathname = { pathname }
591- clickedHref = { clickedHref }
592- setClickedHref = { setClickedHref }
593- />
594- </ div >
564+ return (
565+ < NavigationMenuItem key = { item . name } >
566+ < Link
567+ href = { item . href }
568+ onClick = { ( ) => {
569+ setClickedHref ( item . href ) ;
570+ track ( TELEMETRY_EVENTS . topbar_nav_click , {
571+ link : item . href ,
572+ label : item . name ,
573+ is_mobile : false ,
574+ } ) ;
575+ } }
576+ className = { `${ navigationMenuTriggerStyle ( ) } ${
577+ isActive ? "active" : ""
578+ } `}
579+ >
580+ { item . name }
581+ </ Link >
582+ </ NavigationMenuItem >
583+ ) ;
584+ } ) }
585+ </ NavigationMenuList >
586+ </ NavigationMenu >
587+
588+ { /* Mobile Nav Dropdown — client-only Radix to avoid hydration id drift */ }
589+ < div className = "lg:hidden" >
590+ < MobileNavDropdown
591+ pathname = { pathname }
592+ clickedHref = { clickedHref }
593+ setClickedHref = { setClickedHref }
594+ />
595+ </ div >
596+ </ nav >
595597 </ div >
596598
597599 { /* Right Section */ }
@@ -776,6 +778,6 @@ export default function TopBar() {
776778 </ Button >
777779 </ div >
778780 </ div >
779- </ header >
781+ </ div >
780782 ) ;
781783}
0 commit comments