From 40a731f002a1a83f781d6c66590d8152d8f5a750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20PR=C3=89VOT?= Date: Fri, 4 Oct 2024 16:22:28 +0200 Subject: [PATCH] fix(button): do not make the icon responsive in icon only mode --- packages/fractal/src/components/Button/Button.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/fractal/src/components/Button/Button.tsx b/packages/fractal/src/components/Button/Button.tsx index d6f1e08bc..e073215a6 100644 --- a/packages/fractal/src/components/Button/Button.tsx +++ b/packages/fractal/src/components/Button/Button.tsx @@ -407,14 +407,15 @@ export const Button = forwardRef( : '', !inlineStyle && isTextVariant ? 'mt-0' : '', iconResponsive === false ? 'flex' : 'hidden', - iconResponsive === Breakpoints.xxs || iconResponsive === true + !iconOnly && + (iconResponsive === Breakpoints.xxs || iconResponsive === true) ? 'xs:flex' : '', - iconResponsive === Breakpoints.xs ? 'sm:flex' : '', - iconResponsive === Breakpoints.sm ? 'md:flex' : '', - iconResponsive === Breakpoints.md ? 'lg:flex' : '', - iconResponsive === Breakpoints.lg ? 'xl:flex' : '', - iconResponsive === Breakpoints.xl ? 'xxl:flex' : '', + !iconOnly && iconResponsive === Breakpoints.xs ? 'sm:flex' : '', + !iconOnly && iconResponsive === Breakpoints.sm ? 'md:flex' : '', + !iconOnly && iconResponsive === Breakpoints.md ? 'lg:flex' : '', + !iconOnly && iconResponsive === Breakpoints.lg ? 'xl:flex' : '', + !iconOnly && iconResponsive === Breakpoints.xl ? 'xxl:flex' : '', )} style={ inlineStyle