From f445fe8dda7e44cb8057632ecffe0a327e11257e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B8ran=20Dalum?= Date: Wed, 5 Mar 2025 10:39:06 +0100 Subject: [PATCH] refactor: Remove button icon size parameter (#5058) The parameter was not used in the app, and also the component in Figma doesn't support different izon sizes. --- src/components/button/Button.tsx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/components/button/Button.tsx b/src/components/button/Button.tsx index 581e2def7f..304e08000c 100644 --- a/src/components/button/Button.tsx +++ b/src/components/button/Button.tsx @@ -23,7 +23,6 @@ type ButtonType = 'large' | 'small'; type ButtonIconProps = { svg: ({fill}: {fill: string}) => JSX.Element; - size?: keyof Theme['icon']['size']; notification?: ThemeIconProps['notification']; }; @@ -170,7 +169,7 @@ export const Button = React.forwardRef((props, ref) => { > {leftIcon && ( - + )} {text && ( @@ -191,7 +190,11 @@ export const Button = React.forwardRef((props, ref) => { ) : ( rightIcon && ( - + ) )} @@ -262,11 +265,7 @@ const useTextMarginHorizontal = ( const {theme} = useThemeContext(); if (!expand) return 0; if (!leftIcon && !rightIcon) return 0; - const maxIconSize = Math.max( - theme.icon.size[leftIcon?.size || 'normal'], - theme.icon.size[rightIcon?.size || 'normal'], - ); - return maxIconSize + theme.spacing.xSmall; + return theme.icon.size['normal'] + theme.spacing.xSmall; }; const useButtonStyle = StyleSheet.createThemeHook(() => ({