UNPKG

910 BJavaScriptView Raw
1import React from 'react';
2import { StyleSheet, ActivityIndicator, View, } from 'react-native';
3import { withTheme } from '../config';
4const DialogLoading = ({ loadingStyle, loadingProps, theme, }) => {
5 var _a, _b;
6 return (<View style={styles.loadingView}>
7 <ActivityIndicator style={StyleSheet.flatten([styles.loading, loadingStyle])} color={(_a = loadingProps.color) !== null && _a !== void 0 ? _a : theme.colors.primary} size={(_b = loadingProps.size) !== null && _b !== void 0 ? _b : 'large'} testID="Dialog__Loading" {...loadingProps}/>
8 </View>);
9};
10DialogLoading.defaultProps = {
11 loadingProps: { size: 'large' },
12};
13const styles = StyleSheet.create({
14 loading: {
15 marginVertical: 20,
16 },
17 loadingView: {
18 flexDirection: 'row',
19 justifyContent: 'center',
20 alignItems: 'center',
21 },
22});
23export default withTheme(DialogLoading, 'DialogLoading');
24
\No newline at end of file