File tree Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ const Toast = (props: PropsWithChildren<ToastProps>) => {
32
32
renderAttachment,
33
33
centerMessage,
34
34
showLoader,
35
+ loaderElement,
35
36
action,
36
37
swipeable,
37
38
backgroundColor,
@@ -123,13 +124,14 @@ const Toast = (props: PropsWithChildren<ToastProps>) => {
123
124
// NOTE: order does matter
124
125
if ( showLoader ) {
125
126
return (
126
- < ActivityIndicator
127
- size = { 'small' }
128
- testID = { `${ testID } -loader` }
129
- color = { Colors . rgba ( Colors . $backgroundNeutralHeavy , 0.6 ) }
130
- style = { styles . loader }
131
- />
132
- // <Loader size={Loader.sizes.SMALL} color={loaderColors} style={styles.loader} testID={`${testID}-loader`}/>
127
+ loaderElement ?? (
128
+ < ActivityIndicator
129
+ size = { 'small' }
130
+ testID = { `${ testID } -loader` }
131
+ color = { Colors . rgba ( Colors . $backgroundNeutralHeavy , 0.6 ) }
132
+ style = { styles . loader }
133
+ />
134
+ )
133
135
) ;
134
136
}
135
137
@@ -167,7 +169,9 @@ const Toast = (props: PropsWithChildren<ToastProps>) => {
167
169
} ;
168
170
169
171
const renderIcon = ( ) => {
170
- return < Icon source = { toastPreset . icon } resizeMode = { 'contain' } style = { styles . icon } tintColor = { toastPreset . iconColor } /> ;
172
+ return (
173
+ < Icon source = { toastPreset . icon } resizeMode = { 'contain' } style = { styles . icon } tintColor = { toastPreset . iconColor } />
174
+ ) ;
171
175
} ;
172
176
173
177
const renderToastContent = ( ) => {
Original file line number Diff line number Diff line change
1
+ import { ReactElement } from 'react' ;
1
2
import { ImageSourcePropType , StyleProp , TextStyle , ViewStyle } from 'react-native' ;
2
3
import { ButtonProps } from '../../components/button' ;
3
4
@@ -46,6 +47,10 @@ export interface ToastProps {
46
47
* should show a loader
47
48
*/
48
49
showLoader ?: boolean ;
50
+ /**
51
+ * should show a loader
52
+ */
53
+ loaderElement ?: ReactElement ;
49
54
/**
50
55
* callback for dismiss action
51
56
*/
You can’t perform that action at this time.
0 commit comments