/** * Project iLinkWorld * File SpinnerOverlayComponent * Path components * Created by BRICE ZELE * Date: 01/02/2022 */ import React, {ReactNode} from 'react'; import {ActivityIndicator, Modal, View} from 'react-native'; import Text from './Text'; import I18n from "react-native-i18n"; interface SpinnerOverlayProps { show: boolean; color?: string; backgroundColor?: string; dimLights?: number; children: ReactNode; loadingMessage?: string; } const SpinnerOverlay = ({ show = false, color = '', backgroundColor = '', dimLights = 0.6, loadingMessage = '', children = null }: SpinnerOverlayProps) => { return ( {children !== null ? React.Children.map(children, child => React.cloneElement(child, {}), ) : } {loadingMessage === '' ? I18n.t('LOADING_DOTS') : loadingMessage} ); }; export default SpinnerOverlay;