diff options
Diffstat (limited to 'src/components/moments/MomentUploadProgressBar.tsx')
-rw-r--r-- | src/components/moments/MomentUploadProgressBar.tsx | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/components/moments/MomentUploadProgressBar.tsx b/src/components/moments/MomentUploadProgressBar.tsx index 7310727e..26c20a46 100644 --- a/src/components/moments/MomentUploadProgressBar.tsx +++ b/src/components/moments/MomentUploadProgressBar.tsx @@ -1,6 +1,7 @@ -import React from 'react'; +import React, {useEffect} from 'react'; import {StyleSheet, Text} from 'react-native'; import {View} from 'react-native-animatable'; +import {Easing, useSharedValue, withTiming} from 'react-native-reanimated'; import {SafeAreaView} from 'react-native-safe-area-context'; import {useSelector} from 'react-redux'; import {RootState} from '../../store/rootReducer'; @@ -12,17 +13,20 @@ interface MomentUploadProgressBarProps {} const MomentUploadProgressBar: React.FC<MomentUploadProgressBarProps> = ({}) => { const {momentUploadStatus} = useSelector((state: RootState) => state.user); - // const [progress, setProgress] = useState(0); - // const progressTime = useSharedValue<number>(0); - // const [indeterminate, setIndeterminate] = useState(false); - // const range = new Animated.Value(0); - // const transX = new Animated.Value(0); + const progress = useSharedValue(0); + + useEffect(() => { + progress.value = withTiming(1, { + duration: 5000, + easing: Easing.linear, + }); + }, []); return ( <View style={styles.background}> <SafeAreaView style={styles.container}> <Text style={styles.text}>Uploading Moment...</Text> - <GradientProgressBar style={styles.bar} progress={0.6} /> + <GradientProgressBar style={styles.bar} progress={progress} /> </SafeAreaView> </View> ); |