File tree Expand file tree Collapse file tree 2 files changed +19
-9
lines changed
components/primitives/Button Expand file tree Collapse file tree 2 files changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,10 @@ const Button = (
102
102
< Spinner color = { _text ?. color } { ..._spinner } />
103
103
) ;
104
104
105
+ const boxChildren = ( child : any ) => {
106
+ return < Box _text = { _text } > { child } </ Box > ;
107
+ } ;
108
+
105
109
return (
106
110
< Pressable
107
111
disabled = { isDisabled || isLoading }
@@ -125,12 +129,15 @@ const Button = (
125
129
{ ...resolvedProps }
126
130
accessibilityRole = { props . accessibilityRole ?? 'button' }
127
131
>
128
- < HStack { ..._stack } space = { isLoading && ! isLoadingText ? 0 : 2 } >
132
+ < HStack { ..._stack } test = { true } >
129
133
{ startIcon && ! isLoading ? startIcon : null }
130
134
{ isLoading && spinnerPlacement === 'start' ? spinnerElement : null }
131
- < Box _text = { _text } >
132
- { isLoading ? ( isLoadingText ? isLoadingText : null ) : children }
133
- </ Box >
135
+ { isLoading
136
+ ? isLoadingText
137
+ ? boxChildren ( isLoadingText )
138
+ : null
139
+ : boxChildren ( children ) }
140
+
134
141
{ endIcon && ! isLoading ? endIcon : null }
135
142
{ isLoading && spinnerPlacement === 'end' ? spinnerElement : null }
136
143
</ HStack >
Original file line number Diff line number Diff line change @@ -17,12 +17,15 @@ const baseStyle = (props: any) => {
17
17
flexDirection : 'row' ,
18
18
justifyContent : 'center' ,
19
19
alignItems : 'center' ,
20
+
20
21
_web : {
21
- cursor : props . isDisabled
22
- ? 'not-allowed'
23
- : props . isLoading
24
- ? 'default'
25
- : 'pointer' ,
22
+ _disabled : {
23
+ cursor : 'not-allowed' ,
24
+ } ,
25
+ _loading : {
26
+ cursor : 'not-allowed' ,
27
+ } ,
28
+ cursor : 'pointer' ,
26
29
} ,
27
30
_text : {
28
31
fontWeight : 'medium' ,
You can’t perform that action at this time.
0 commit comments