diff --git a/squarenotsquare/src/components/Spinner.js b/squarenotsquare/src/components/Spinner.js new file mode 100644 index 0000000..0f23561 --- /dev/null +++ b/squarenotsquare/src/components/Spinner.js @@ -0,0 +1,39 @@ +import React from "react"; +import { Animated, Easing} from "react-native"; +import { useEffect } from "react"; +import MaterialIcon from 'react-native-vector-icons/MaterialCommunityIcons'; +import Icons from '../themes/Icons'; +import Colors from "../themes/Colors"; +import Metrics from "../themes/Metrics"; + +const spinValue = new Animated.Value(0); + +function Spinner(){ + + useEffect(() => { + Animated.loop( + Animated.timing(spinValue, { + toValue: 1, + duration: 3000, + easing: Easing.linear, + useNativeDriver: true, + })).start(); + }, []); + + const spin = spinValue.interpolate({ + inputRange: [0, 1], + outputRange: ['0deg', '360deg'], + }); + + return ( + + + + ) +} + +export default Spinner; \ No newline at end of file