File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,8 @@ interface AppHeaderProps {
43
43
}
44
44
45
45
export function AppHeader ( { breadcrumbs = [ ] } : AppHeaderProps ) {
46
- const { auth } = usePage < SharedData > ( ) . props ;
46
+ const page = usePage < SharedData > ( ) ;
47
+ const { auth } = page . props ;
47
48
const getInitials = useInitials ( ) ;
48
49
return (
49
50
< >
@@ -105,12 +106,18 @@ export function AppHeader({ breadcrumbs = [] }: AppHeaderProps) {
105
106
< NavigationMenuItem key = { index } className = "relative flex h-full items-center" >
106
107
< Link
107
108
href = { item . url }
108
- className = { cn ( navigationMenuTriggerStyle ( ) , activeItemStyles , 'h-9 cursor-pointer px-3' ) }
109
+ className = { cn (
110
+ navigationMenuTriggerStyle ( ) ,
111
+ page . url === item . url && activeItemStyles ,
112
+ 'h-9 cursor-pointer px-3' ,
113
+ ) }
109
114
>
110
115
{ item . icon && < Icon iconNode = { item . icon } className = "mr-2 h-4 w-4" /> }
111
116
{ item . title }
112
117
</ Link >
113
- < div className = "absolute bottom-0 left-0 h-0.5 w-full translate-y-px bg-black dark:bg-white" > </ div >
118
+ { page . url === item . url && (
119
+ < div className = "absolute bottom-0 left-0 h-0.5 w-full translate-y-px bg-black dark:bg-white" > </ div >
120
+ ) }
114
121
</ NavigationMenuItem >
115
122
) ) }
116
123
</ NavigationMenuList >
You can’t perform that action at this time.
0 commit comments