From 158fc984d04f479e8439ea3e5652bc9b5090eba0 Mon Sep 17 00:00:00 2001 From: Dylan Kilgore Date: Thu, 21 Sep 2023 11:37:07 -0700 Subject: [PATCH] fix: linkbutton: fixes counter position when button only contains an icon --- src/components/LinkButton/LinkButton.tsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/components/LinkButton/LinkButton.tsx b/src/components/LinkButton/LinkButton.tsx index f30d072ca..98d5bb5a4 100644 --- a/src/components/LinkButton/LinkButton.tsx +++ b/src/components/LinkButton/LinkButton.tsx @@ -316,10 +316,21 @@ export const LinkButton: FC = React.forwardRef( {getPrefixIcon()} )} - {iconExists && !textExists && !prefixIconExists && getLinkButtonIcon()} - {counterExists && !textExists && !loading && ( + {iconExists && + !textExists && + !prefixIconExists && + !counterExists && + getLinkButtonIcon()} + {counterExists && !textExists && !loading && !iconExists && ( {counter} )} + {iconExists && counterExists && !textExists && !loading && ( + + {getLinkButtonIcon()} + {counter} + {prefixIconExists && getPrefixIcon()} + + )} {iconExists && textExists && ( {getLinkButtonIcon()}