connect-transfer-react-native-sdk
Version:
Connect Transfer React Native SDK for Mastercard Open Banking Connect
43 lines (42 loc) • 1.15 kB
JavaScript
;
import React from 'react';
import { View } from 'react-native';
import Animated, { useAnimatedStyle, useSharedValue, withRepeat, withTiming, Easing } from 'react-native-reanimated';
import { LoaderStyle as styles } from './ComponentStyles';
import { jsx as _jsx } from "react/jsx-runtime";
const MALoader = ({
size = 80,
color = '#CF4500',
strokeWidth = 8,
borderRadius = 40
}) => {
const rotation = useSharedValue(0);
React.useEffect(() => {
rotation.value = withRepeat(withTiming(1, {
duration: 1500,
easing: Easing.linear
}), -1);
}, []);
const animatedStyle = useAnimatedStyle(() => ({
transform: [{
rotate: `${rotation.value * 360}deg`
}]
}));
const customStyle = {
height: size,
width: size,
borderLeftColor: color,
borderTopColor: color,
borderWidth: strokeWidth,
borderRadius
};
return /*#__PURE__*/_jsx(View, {
style: styles.container,
testID: "loader-box",
children: /*#__PURE__*/_jsx(Animated.View, {
style: [styles.box, animatedStyle, customStyle]
})
});
};
export default MALoader;
//# sourceMappingURL=MALoader.js.map