Skip to content

Commit

Permalink
fix(ConfigMenu): Added support for disabling menu entries
Browse files Browse the repository at this point in the history
  • Loading branch information
HHogg committed Dec 11, 2023
1 parent 3101fd7 commit aa1bfce
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions workspaces/package/src/ConfigMenu/ConfigMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type MenuConfig = MenuConfigEntry[];
export type MenuConfigEntry<T = MenuConfigEntryValue> = {
label: string;
icon: LucideIcon;
disabled?: boolean;
config: T;
};

Expand Down Expand Up @@ -170,6 +171,7 @@ export const ConfigMenu = ({
<MenuItemAction
Icon={entry.icon}
title={entry.label}
disabled={entry.disabled}
onClick={(event) => {
event.stopPropagation();

Expand All @@ -181,6 +183,7 @@ export const ConfigMenu = ({
) : (
<MenuItemNavigate
Icon={entry.icon}
disabled={entry.disabled}
onClick={() => setActiveKey(entry.label)}
title={entry.label}
value={getLabel(entry)}
Expand Down

0 comments on commit aa1bfce

Please sign in to comment.