@@ -257,36 +257,39 @@ class Button extends Component {
257
257
] }
258
258
nativeID = { this . props . nativeID }
259
259
>
260
- { ( { pressed, hovered} ) => (
261
- < OpacityView
262
- shouldDim = { pressed }
263
- style = { [
264
- styles . button ,
265
- this . props . small ? styles . buttonSmall : undefined ,
266
- this . props . medium ? styles . buttonMedium : undefined ,
267
- this . props . large ? styles . buttonLarge : undefined ,
268
- this . props . extraLarge ? styles . buttonExtraLarge : undefined ,
269
- this . props . success ? styles . buttonSuccess : undefined ,
270
- this . props . danger ? styles . buttonDanger : undefined ,
271
- ( this . props . isDisabled && this . props . success ) ? styles . buttonSuccessDisabled : undefined ,
272
- ( this . props . isDisabled && this . props . danger ) ? styles . buttonDangerDisabled : undefined ,
273
- ( this . props . isDisabled && ! this . props . danger && ! this . props . success ) ? styles . buttonDisable : undefined ,
274
- ( this . props . success && hovered ) ? styles . buttonSuccessHovered : undefined ,
275
- ( this . props . danger && hovered ) ? styles . buttonDangerHovered : undefined ,
276
- this . props . shouldRemoveRightBorderRadius ? styles . noRightBorderRadius : undefined ,
277
- this . props . shouldRemoveLeftBorderRadius ? styles . noLeftBorderRadius : undefined ,
278
- ...this . props . innerStyles ,
279
- ] }
280
- >
281
- { this . renderContent ( ) }
282
- { this . props . isLoading && (
283
- < ActivityIndicator
284
- color = { ( this . props . success || this . props . danger ) ? themeColors . textReversed : themeColors . text }
285
- style = { [ styles . pAbsolute , styles . l0 , styles . r0 ] }
286
- />
287
- ) }
288
- </ OpacityView >
289
- ) }
260
+ { ( { pressed, hovered} ) => {
261
+ const activeAndHovered = ! this . props . isDisabled && hovered ;
262
+ return (
263
+ < OpacityView
264
+ shouldDim = { pressed }
265
+ style = { [
266
+ styles . button ,
267
+ this . props . small ? styles . buttonSmall : undefined ,
268
+ this . props . medium ? styles . buttonMedium : undefined ,
269
+ this . props . large ? styles . buttonLarge : undefined ,
270
+ this . props . extraLarge ? styles . buttonExtraLarge : undefined ,
271
+ this . props . success ? styles . buttonSuccess : undefined ,
272
+ this . props . danger ? styles . buttonDanger : undefined ,
273
+ ( this . props . isDisabled && this . props . success ) ? styles . buttonSuccessDisabled : undefined ,
274
+ ( this . props . isDisabled && this . props . danger ) ? styles . buttonDangerDisabled : undefined ,
275
+ ( this . props . isDisabled && ! this . props . danger && ! this . props . success ) ? styles . buttonDisable : undefined ,
276
+ ( this . props . success && activeAndHovered ) ? styles . buttonSuccessHovered : undefined ,
277
+ ( this . props . danger && activeAndHovered ) ? styles . buttonDangerHovered : undefined ,
278
+ this . props . shouldRemoveRightBorderRadius ? styles . noRightBorderRadius : undefined ,
279
+ this . props . shouldRemoveLeftBorderRadius ? styles . noLeftBorderRadius : undefined ,
280
+ ...this . props . innerStyles ,
281
+ ] }
282
+ >
283
+ { this . renderContent ( ) }
284
+ { this . props . isLoading && (
285
+ < ActivityIndicator
286
+ color = { ( this . props . success || this . props . danger ) ? themeColors . textReversed : themeColors . text }
287
+ style = { [ styles . pAbsolute , styles . l0 , styles . r0 ] }
288
+ />
289
+ ) }
290
+ </ OpacityView >
291
+ ) ;
292
+ } }
290
293
</ Pressable >
291
294
) ;
292
295
}
0 commit comments