@@ -48,13 +48,13 @@ const Button = React.forwardRef<any, Partial<PropsWithLayout<ButtonProps>>>(
4848 loadingProps,
4949 loadingColor,
5050 opacityConfig,
51- radius = 'xs' ,
5251 mode = 'solid' ,
5352 dir : direction ,
5453 pressableConfig,
5554 disabledTitleStyle,
5655 disabledTitleColor,
5756 disabledButtonColor,
57+ radius = typeof children === 'string' || ! ! title ? 'xs' : 0 ,
5858 size = typeof children === 'string' || ! ! title ? 'md' : undefined ,
5959 type = typeof children === 'string' || ! ! title ? 'primary' : undefined ,
6060 onPress,
@@ -77,6 +77,10 @@ const Button = React.forwardRef<any, Partial<PropsWithLayout<ButtonProps>>>(
7777 } ,
7878 } ) ;
7979
80+ const hasTitle = React . useMemo ( ( ) => {
81+ return typeof children === 'string' || ! ! title ;
82+ } , [ children , title ] ) ;
83+
8084 const textColor = React . useMemo ( ( ) => {
8185 const selectedColor = disabled
8286 ? disabledTitleColor ?? colors ?. secondText
@@ -134,26 +138,32 @@ const Button = React.forwardRef<any, Partial<PropsWithLayout<ButtonProps>>>(
134138 paddingHorizontal : rs ( DefaultSizes [ size ] ) * 1.2 ,
135139 } ;
136140 }
141+ if ( hasTitle ) {
142+ appliedStyles = {
143+ ...appliedStyles ,
144+ alignItems : 'center' ,
145+ } ;
146+ }
137147 return {
138148 ...appliedStyles ,
139149 overflow : 'hidden' ,
140- alignItems : 'center' ,
141150 borderRadius : rs (
142151 typeof radius === 'number' ? radius : DefaultSizes [ radius ] / 2 ,
143152 ) ,
144153 } ;
145154 } , [
146- rs ,
147- size ,
155+ disabled ,
156+ disabledButtonColor ,
157+ colors ?. disabled ,
158+ color ,
148159 type ,
149160 mode ,
150- color ,
151- radius ,
152161 shadow ,
153- disabled ,
162+ size ,
163+ hasTitle ,
164+ rs ,
154165 borderColor ,
155- disabledButtonColor ,
156- colors ?. disabled ,
166+ radius ,
157167 ] ) ;
158168
159169 const memorizedTitleStyle = useStyle < TextStyle > ( ( ) => {
@@ -268,7 +278,7 @@ const Button = React.forwardRef<any, Partial<PropsWithLayout<ButtonProps>>>(
268278 { ...loadingProps }
269279 style = { loadingLayoutStyle }
270280 />
271- ) : typeof children === 'string' || ! ! title ? (
281+ ) : hasTitle ? (
272282 < Text
273283 testID = "FAST_BASE_BUTTON_TITLE"
274284 style = { textLayoutStyle }
0 commit comments