mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-12 20:10:09 +02:00
fix: renamed folder MainMenu->main-menu and support rest props (#6103)
* renamed folder MainMenu -> main-menu * rename ariaLabel -> aria-label and dataTestId -> data-testid * allow rest props * fix * lint * add ts check * ts for div * fix * fix * fix
This commit is contained in:
@@ -9,30 +9,23 @@ const DropdownMenuItem = ({
|
||||
icon,
|
||||
onSelect,
|
||||
children,
|
||||
dataTestId,
|
||||
shortcut,
|
||||
className,
|
||||
style,
|
||||
ariaLabel,
|
||||
...rest
|
||||
}: {
|
||||
icon?: JSX.Element;
|
||||
onSelect: () => void;
|
||||
children: React.ReactNode;
|
||||
dataTestId?: string;
|
||||
shortcut?: string;
|
||||
className?: string;
|
||||
style?: React.CSSProperties;
|
||||
ariaLabel?: string;
|
||||
}) => {
|
||||
} & React.ButtonHTMLAttributes<HTMLButtonElement>) => {
|
||||
return (
|
||||
<button
|
||||
aria-label={ariaLabel}
|
||||
{...rest}
|
||||
onClick={onSelect}
|
||||
data-testid={dataTestId}
|
||||
title={ariaLabel}
|
||||
type="button"
|
||||
className={getDrodownMenuItemClassName(className)}
|
||||
style={style}
|
||||
title={rest.title ?? rest["aria-label"]}
|
||||
>
|
||||
<MenuItemContent icon={icon} shortcut={shortcut}>
|
||||
{children}
|
||||
|
Reference in New Issue
Block a user