Skip to content

Commit

Permalink
fix(app-admin): hide tooltip for disabled icon button (#4327)
Browse files Browse the repository at this point in the history
  • Loading branch information
leopuleo authored Oct 10, 2024
1 parent 3879e0f commit c2bad0d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/app-admin/src/components/Buttons/Buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,20 @@ export const ButtonSecondary = ({ onAction, ...other }: ButtonProps) => {
return <BaseButtonSecondary {...other} onClick={onAction} />;
};

export const IconButton = ({ label, onAction, tooltipPlacement, ...other }: IconButtonProps) => {
if (label) {
export const IconButton = ({
label,
onAction,
tooltipPlacement,
disabled,
...other
}: IconButtonProps) => {
if (label && !disabled) {
return (
<Tooltip content={label} placement={tooltipPlacement}>
<BaseIconButton {...other} onClick={onAction} />
</Tooltip>
);
}

return <BaseIconButton {...other} onClick={onAction} />;
return <BaseIconButton {...other} onClick={onAction} disabled={disabled} />;
};

0 comments on commit c2bad0d

Please sign in to comment.