Skip to content

Commit

Permalink
fix(): Show sub items in mobile menu.
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanCQ committed Oct 28, 2024
1 parent fb12d23 commit 914429a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/custom/docs/components/navmenu/MobileMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,18 @@ import { MenuIcon } from "lucide-react"
}[],
}[];
}) => {
return <DropdownMenu>
return <DropdownMenu >
<DropdownMenuTrigger asChild><Button variant='outline' className="w-8 p-0 h-8"> <MenuIcon/></Button></DropdownMenuTrigger>
<DropdownMenuContent>
<DropdownMenuContent className="max-h-50vh overflow-y-auto" >
{props.navTextLinks.map(link => {
return <DropdownMenuItem asChild key={link.title}><a href={link.href}>{link.title}</a></DropdownMenuItem>
return <><DropdownMenuItem asChild key={link.title}><a href={link.href}>{link.title}</a>
</DropdownMenuItem>
{link.dropDown.map(subitem => {
return <DropdownMenuItem className="text-xs ml-2 text-muted-foreground last:mb-4" key={subitem.title} asChild ><a href={subitem.href}>{subitem.title}</a></DropdownMenuItem>
})}
</>
})}
{}
</DropdownMenuContent>
</DropdownMenu>
}

0 comments on commit 914429a

Please sign in to comment.