File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
src/components/primitives/Button Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -96,14 +96,16 @@ const Button = (
96
96
) ;
97
97
}
98
98
99
- const boxChildren = isLoading && isLoadingText ? isLoadingText : children ;
100
-
101
99
const spinnerElement = spinner ? (
102
100
spinner
103
101
) : (
104
102
< Spinner color = { _text ?. color } { ..._spinner } />
105
103
) ;
106
104
105
+ const boxChildren = ( child : any ) => {
106
+ return < Box _text = { _text } > { child } </ Box > ;
107
+ } ;
108
+
107
109
return (
108
110
< Pressable
109
111
disabled = { isDisabled || isLoading }
@@ -127,14 +129,15 @@ const Button = (
127
129
{ ...resolvedProps }
128
130
accessibilityRole = { props . accessibilityRole ?? 'button' }
129
131
>
130
- < HStack { ..._stack } >
132
+ < HStack { ..._stack } test = { true } >
131
133
{ startIcon && ! isLoading ? startIcon : null }
132
134
{ isLoading && spinnerPlacement === 'start' ? spinnerElement : null }
133
- { boxChildren ? (
134
- < Box _text = { _text } >
135
- { isLoading && isLoadingText ? isLoadingText : children }
136
- </ Box >
137
- ) : null }
135
+ { isLoading
136
+ ? isLoadingText
137
+ ? boxChildren ( isLoadingText )
138
+ : null
139
+ : boxChildren ( children ) }
140
+
138
141
{ endIcon && ! isLoading ? endIcon : null }
139
142
{ isLoading && spinnerPlacement === 'end' ? spinnerElement : null }
140
143
</ HStack >
You can’t perform that action at this time.
0 commit comments