Skip to content

Commit 299b86c

Browse files
committed
make disabled buttons force greyed out
1 parent b4c7ef4 commit 299b86c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

packages/web_common/src/components/ContextMenu.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,15 @@ export function ContextMenu<T extends object>({
8787
);
8888
}
8989

90-
ContextMenu.Item = <T extends object>({ className, ...rest }: MenuItemProps<T>) => <MenuItem {...rest} className={twMerge('rounded-sm px-3 py-1 hover:bg-component-bg-hover', className?.toString())} />;
90+
ContextMenu.Item = <T extends object>({
91+
className,
92+
isDisabled,
93+
...rest
94+
}: MenuItemProps<T>) =>
95+
<MenuItem
96+
{...rest}
97+
className={twMerge('rounded-sm px-3 py-1 hover:bg-component-bg-hover', className?.toString(), isDisabled ? 'text-gray-700' : '')}
98+
isDisabled={isDisabled}
99+
/>;
91100

92101
ContextMenu.Separator = ({ className, ...rest }: SeparatorProps) => <Separator {...rest} className={twMerge('my-1 py-0.25 bg-component-border', className)} />;

0 commit comments

Comments
 (0)