UNPKG

@eslam-elmeniawy/react-native-common-components

Version:

Common `ReactNative` components packed in library for usage in projects.

40 lines (37 loc) 1.39 kB
"use strict"; // External imports. import * as React from 'react'; import { StyleSheet, View } from 'react-native'; // Types imports. // Internal imports. import styles from "./ImagePlaceholder.styles.js"; import { jsx as _jsx } from "react/jsx-runtime"; const Loading = /*#__PURE__*/React.memo(props => { try { const Progress = require('react-native-progress'); require('react-native-svg'); const { loadingProps, theme, setProgressSizeState, progress, progressSize } = props; return /*#__PURE__*/_jsx(View, { style: StyleSheet.flatten([styles.image, styles.loadingContainer, { backgroundColor: loadingProps?.backgroundColor == null || loadingProps?.backgroundColor === undefined ? theme.colors.backdrop : loadingProps?.backgroundColor }]), onLayout: event => setProgressSizeState((event.nativeEvent.layout.width > event.nativeEvent.layout.height ? event.nativeEvent.layout.height : event.nativeEvent.layout.width) / 2), children: /*#__PURE__*/_jsx(Progress.Pie, { indeterminate: progress <= 0, size: progressSize, progress: progress, color: loadingProps?.color == null || loadingProps?.color === undefined ? theme.colors.surface : loadingProps?.color }) }); } catch (error) { return null; } }); export default Loading; //# sourceMappingURL=Loading.js.map