Skip to content

Commit

Permalink
add a wrapper span so we can pass a disabled button (#2322)
Browse files Browse the repository at this point in the history
  • Loading branch information
codebykat authored Sep 3, 2020
1 parent 525d3cb commit 406ed56
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions lib/icon-button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,22 @@ type OwnProps = {
type Props = OwnProps;

export const IconButton = ({ icon, title, ...props }: Props) => (
<Tooltip
classes={{ tooltip: 'icon-button__tooltip' }}
enterDelay={200}
title={title}
>
<button className="icon-button" type="button" data-title={title} {...props}>
{icon}
</button>
</Tooltip>
<span>
<Tooltip
classes={{ tooltip: 'icon-button__tooltip' }}
enterDelay={200}
title={title}
>
<button
className="icon-button"
type="button"
data-title={title}
{...props}
>
{icon}
</button>
</Tooltip>
</span>
);

export default IconButton;

0 comments on commit 406ed56

Please sign in to comment.