mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Initial attempt @ submenu implementation.
This commit is contained in:
parent
9c3ff73a73
commit
14ad745d00
8 changed files with 156 additions and 19 deletions
29
src/components/dropdownMenu/DropdownMenuSubTrigger.tsx
Normal file
29
src/components/dropdownMenu/DropdownMenuSubTrigger.tsx
Normal file
|
@ -0,0 +1,29 @@
|
|||
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
||||
import React from "react";
|
||||
import MenuItemContent from "./DropdownMenuItemContent";
|
||||
import { getDropdownMenuItemClassName } from "./common";
|
||||
|
||||
const DropdownMenuSubTrigger = ({
|
||||
children,
|
||||
icon,
|
||||
shortcut,
|
||||
className,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
icon?: JSX.Element;
|
||||
shortcut?: string;
|
||||
className?: string;
|
||||
}) => {
|
||||
return (
|
||||
<DropdownMenuPrimitive.SubTrigger
|
||||
className={getDropdownMenuItemClassName(className)}
|
||||
>
|
||||
<MenuItemContent icon={icon} shortcut={shortcut}>
|
||||
{children}
|
||||
</MenuItemContent>
|
||||
</DropdownMenuPrimitive.SubTrigger>
|
||||
);
|
||||
};
|
||||
|
||||
export default DropdownMenuSubTrigger;
|
||||
DropdownMenuSubTrigger.displayName = "DropdownMenuSubTrigger";
|
Loading…
Add table
Add a link
Reference in a new issue