Skip to content

Commit

Permalink
fix: linkbutton: fixes counter position when button only contains an …
Browse files Browse the repository at this point in the history
…icon
  • Loading branch information
dkilgore-eightfold committed Sep 21, 2023
1 parent 1770722 commit 158fc98
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/components/LinkButton/LinkButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,21 @@ export const LinkButton: FC<LinkButtonProps> = React.forwardRef(
{getPrefixIcon()}
</span>
)}
{iconExists && !textExists && !prefixIconExists && getLinkButtonIcon()}
{counterExists && !textExists && !loading && (
{iconExists &&
!textExists &&
!prefixIconExists &&
!counterExists &&
getLinkButtonIcon()}
{counterExists && !textExists && !loading && !iconExists && (
<Badge classNames={badgeClassNames}>{counter}</Badge>
)}
{iconExists && counterExists && !textExists && !loading && (
<span>
{getLinkButtonIcon()}
<Badge classNames={badgeClassNames}>{counter}</Badge>
{prefixIconExists && getPrefixIcon()}
</span>
)}
{iconExists && textExists && (
<span>
{getLinkButtonIcon()}
Expand Down

0 comments on commit 158fc98

Please sign in to comment.