generated from Blazity/next-enterprise
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7125e58
commit 4ab65e0
Showing
4 changed files
with
99 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
"use client" | ||
import * as DropdownMenu from "@radix-ui/react-dropdown-menu" | ||
import { ChevronDownIcon } from "@radix-ui/react-icons" | ||
import { LinkSpec } from "./types" | ||
|
||
export const SubNavList: React.FC<{ title: string, subLinks: Array<LinkSpec> }> = ({ title, subLinks }) => { | ||
return ( | ||
<DropdownMenu.Root> | ||
<DropdownMenu.Trigger asChild> | ||
<button | ||
className="outline-none flex items-center text-white cursor-pointer group" | ||
aria-label="Customise options" | ||
> | ||
{title} | ||
{/* chevron down */} | ||
<ChevronDownIcon className="w-4 h-4" /> | ||
</button> | ||
</DropdownMenu.Trigger> | ||
<DropdownMenu.Portal> | ||
<DropdownMenu.Content | ||
className="data-[side=top]:animate-slideDownAndFade data-[side=right]:animate-slideLeftAndFade data-[side=bottom]:animate-slideUpAndFade data-[side=left]:animate-slideRightAndFade min-w-[220px] rounded-md bg-white p-[5px] shadow-[0px_10px_38px_-10px_rgba(22,_23,_24,_0.35),_0px_10px_20px_-15px_rgba(22,_23,_24,_0.2)] will-change-[opacity,transform]" | ||
sideOffset={5} | ||
> | ||
{subLinks.map((link, li) => { | ||
return ( | ||
<DropdownMenu.Item | ||
key={li} | ||
className="group relative flex h-[25px] select-none items-center rounded-[3px] px-[5px] text-[13px] leading-none outline-none" | ||
> | ||
<a href={link.path} className="flex items-center"> | ||
{link.title} | ||
</a> | ||
</DropdownMenu.Item> | ||
) | ||
})} | ||
</DropdownMenu.Content> | ||
</DropdownMenu.Portal> | ||
</DropdownMenu.Root> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters