@@ -11,7 +11,6 @@ import {
1111 SidebarMenuItem ,
1212 useSidebar ,
1313} from "@/components/ui/sidebar" ;
14- import { cn } from "@/utils/utils" ;
1514
1615import { NavLink } from "../nav-link" ;
1716
@@ -45,7 +44,7 @@ const NAV_ITEM_TOUR_MAP: Record<string, string> = {
4544 Billing : "billing-nav" ,
4645} ;
4746
48- function NavMainItem ( { item, open } : { item : NavMainItem ; open : boolean } ) {
47+ function NavMainItem ( { item } : { item : NavMainItem } ) {
4948 const dataTour = NAV_ITEM_TOUR_MAP [ item . title ] ;
5049
5150 return (
@@ -58,16 +57,11 @@ function NavMainItem({ item, open }: { item: NavMainItem; open: boolean }) {
5857 < NavLink
5958 to = { item . url }
6059 end = { item . end }
61- className = "whitespace-nowrap"
60+ className = "overflow-hidden whitespace-nowrap"
6261 activeClassName = "[&>span]:text-foreground! bg-neutral-300/50 dark:bg-neutral-600/50 hover:bg-neutral-300/50 dark:hover:bg-neutral-600/50 focus:bg-neutral-300/50 dark:focus:bg-neutral-600/50 active:bg-neutral-300/50 dark:active:bg-neutral-600/50"
6362 >
6463 { item . icon && < item . icon /> }
65- < span
66- className = { cn (
67- "text-sm transition-opacity text-neutral-600 dark:text-neutral-400" ,
68- open ? "opacity-100" : "opacity-0"
69- ) }
70- >
64+ < span className = "text-sm text-neutral-600 dark:text-neutral-400 group-data-[collapsible=icon]:hidden" >
7165 { item . title }
7266 </ span >
7367 </ NavLink >
@@ -103,7 +97,7 @@ export function NavMain({ groups, footerItems }: NavMainProps) {
10397 ) }
10498 < SidebarMenu className = "bg-transparent" >
10599 { group . items . map ( ( item ) => (
106- < NavMainItem key = { item . title } item = { item } open = { open } />
100+ < NavMainItem key = { item . title } item = { item } />
107101 ) ) }
108102 </ SidebarMenu >
109103 </ SidebarGroup >
@@ -113,21 +107,16 @@ export function NavMain({ groups, footerItems }: NavMainProps) {
113107 < SidebarMenu className = "bg-transparent px-4" >
114108 { footerItems &&
115109 footerItems . map ( ( item ) => (
116- < NavMainItem key = { item . title } item = { item } open = { open } />
110+ < NavMainItem key = { item . title } item = { item } />
117111 ) ) }
118112 < SidebarMenuItem >
119113 < SidebarMenuButton
120114 tooltip = "Toggle sidebar"
121115 onClick = { toggleSidebar }
122- className = "hover:bg-neutral-200/50 dark:hover:bg-neutral-800/50 transition-colors mt-1 mb-5"
116+ className = "hover:bg-neutral-200/50 dark:hover:bg-neutral-800/50 transition-colors mt-1 mb-5 overflow-hidden whitespace-nowrap "
123117 >
124118 { open ? < PanelLeftClose /> : < PanelLeftOpen /> }
125- < span
126- className = { cn (
127- "uppercase text-semibold text-xs transition-opacity" ,
128- open ? "opacity-100" : "opacity-0"
129- ) }
130- >
119+ < span className = "uppercase text-semibold text-xs group-data-[collapsible=icon]:hidden" >
131120 Collapse
132121 </ span >
133122 </ SidebarMenuButton >
0 commit comments