Skip to content

Commit

Permalink
Fix button icon case
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfp13 committed Jul 21, 2022
1 parent 71cf3fb commit 342388a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/ui/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ function Button({
disabled,
...props
}: ButtonProps) {
const isButtonIcon = icon && !iconPosition

return (
<UIButton
aria-label={ariaLabel}
Expand All @@ -62,9 +64,7 @@ function Button({
disabled={disabled}
{...props}
>
{(!iconPosition || iconPosition === 'left') && (
<UIIcon component={icon} />
)}
{(isButtonIcon || iconPosition === 'left') && <UIIcon component={icon} />}
{children}
{iconPosition === 'right' && <UIIcon component={icon} />}
</UIButton>
Expand Down

0 comments on commit 342388a

Please sign in to comment.