Resolve "implement updating a category"
This commit is contained in:
parent
0ddfe3e606
commit
d7bb318c24
6 changed files with 25 additions and 14 deletions
|
|
@ -1,15 +1,15 @@
|
|||
import React, { useEffect, useRef } from "react";
|
||||
import { StyleSheet, View, Animated, Easing, ActivityIndicator } from "react-native";
|
||||
import { ActivityIndicator, Animated, Easing, StyleSheet, View } from "react-native";
|
||||
import { useTheme } from "../../app/contexts/ThemeContext";
|
||||
|
||||
const LoadingSymbol = () => {
|
||||
const color = ["blue", "red", "purple", "green", "yellow", "orange"];
|
||||
const random = Math.floor(Math.random() * color.length);
|
||||
const {colors} = useTheme();
|
||||
|
||||
const spinValue = useRef(new Animated.Value(0)).current;
|
||||
|
||||
const spin = spinValue.interpolate({
|
||||
inputRange: [0, 1],
|
||||
outputRange: ["0deg", "360deg"],
|
||||
outputRange: [0, 360],
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -25,7 +25,6 @@ const LoadingSymbol = () => {
|
|||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
backgroundColor: color[random],
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
position: "absolute",
|
||||
|
|
@ -35,13 +34,14 @@ const LoadingSymbol = () => {
|
|||
loader: {
|
||||
width: 100,
|
||||
height: 100,
|
||||
transform: [{ rotate: spin }],
|
||||
transform: [{ rotate: spin + "deg"}],
|
||||
zIndex: 999,
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<ActivityIndicator size="large" color="black" style={styles.loader} />
|
||||
<ActivityIndicator size="large" color={colors.accentColor} style={styles.loader} />
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Reference in a new issue