@brightlayer-ui/react-native-auth-workflow
Version:
Re-usable workflow components for Authentication and Registration within Eaton applications.
39 lines (38 loc) • 1.58 kB
JavaScript
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
import React from 'react';
import { View } from 'react-native';
import { ActivityIndicator } from 'react-native-paper';
import { useExtendedTheme } from '@brightlayer-ui/react-native-themes';
/**
* Component that renders a indeterminate circular progress spinner atop a semi-transparent white background.
*
* @param {SpinnerProps} props - Props of Spinner component
*
* @category Component
*/
export const Spinner = (props) => {
const { visible } = props, otherProps = __rest(props, ["visible"]);
const theme = useExtendedTheme();
return (React.createElement(View, Object.assign({ style: {
top: 0,
left: 0,
height: '100%',
width: '100%',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
position: 'absolute',
backgroundColor: `rgba(255,255,255,${theme.dark ? 0.15 : 0.75})`,
}, testID: "blui-spinner" }, otherProps),
React.createElement(ActivityIndicator, { animating: visible, size: "large", color: theme.colors.primary })));
};