@resourge/react-fetch
Version:
[](LICENSE)
47 lines (44 loc) • 1.13 kB
JavaScript
/**
* react-fetch v1.43.1
*
* Copyright (c) resourge.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
import 'react';
import { View } from 'react-native';
import Loader from '../Loader';
import { GlobalLoading } from './GlobalLoading.native';
import { setGlobalLoading, globalColor } from './constants';
import { jsx } from 'react/jsx-runtime';
const GlobalLoader = ({
loaderId,
style,
children,
color = globalColor
}) => {
const globalLoading = setGlobalLoading(children != null ? children : jsx(GlobalLoading, {
color: color
}));
return jsx(Loader, {
loaderId: loaderId,
loadingElement: jsx(View, {
style: [{
flex: 1,
position: 'absolute',
width: '100%',
height: '100%',
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'rgba(0,0,0,0.5)',
elevation: 1000
}, style],
children: globalLoading
})
});
};
export { GlobalLoader as default };
//# sourceMappingURL=GlobalLoader.native.js.map