@@ -5,15 +5,13 @@ import {
55 TouchableOpacity ,
66 View ,
77} from 'react-native' ;
8- import { DeepPartial } from 'ts-essentials' ;
98
109import { ButtonColor , ControlSize , useTheme } from '../../theme' ;
11- import { mergeStyles , ReplaceReturnType } from '../../utils/mergeStyles' ;
10+ import { mergeStyles } from '../../utils/mergeStyles' ;
1211import { Dots } from '../LoadingIndicators' ;
1312import { Text } from '../Typography' ;
1413import {
1514 ButtonAppearance ,
16- ButtonStyles ,
1715 GetButtonStyles ,
1816 getButtonStyles ,
1917} from './Button.styles' ;
@@ -86,7 +84,7 @@ export interface ButtonProps {
8684 accessible ?: boolean ;
8785
8886 /** Callback to get element styles. */
89- getStyles ?: ReplaceReturnType < GetButtonStyles , DeepPartial < ButtonStyles > > ;
87+ getStyles ?: GetButtonStyles ;
9088
9189 /** Used to locate this view in end-to-end tests. */
9290 testID ?: string ;
@@ -144,14 +142,21 @@ export const Button = (props: ButtonProps) => {
144142} ;
145143
146144export interface ButtonContentProps extends ButtonProps {
147- textStyle : TextStyle ;
145+ textStyle ? : TextStyle ;
148146}
149147
150148const ButtonContent = ( props : ButtonContentProps ) => {
151149 const { isLoading, iconLoading, icon, title, textStyle } = props ;
150+ const theme = useTheme ( ) ;
152151
153152 if ( isLoading ) {
154- return < > { iconLoading || < Dots color = { textStyle . color } /> } </ > ;
153+ return (
154+ < >
155+ { iconLoading || (
156+ < Dots color = { textStyle ? textStyle . color : theme . colors . text . white } />
157+ ) }
158+ </ >
159+ ) ;
155160 }
156161 if ( icon ) return < > { icon } </ > ;
157162 if ( title ) {
0 commit comments