diff --git a/src/components/Image/index.tsx b/src/components/Image/index.tsx index 93558fc..a6edfc2 100644 --- a/src/components/Image/index.tsx +++ b/src/components/Image/index.tsx @@ -1,7 +1,7 @@ import { Image, View } from 'react-native'; import React, { FC, memo, useState } from 'react'; -import { - runOnJS, useAnimatedReaction, useDerivedValue, useSharedValue, +import Animated, { + runOnJS, useAnimatedReaction, useAnimatedStyle, useDerivedValue, useSharedValue, } from 'react-native-reanimated'; import { StoryImageProps } from '../../core/dto/componentsDTO'; import Loader from '../Loader'; @@ -24,6 +24,10 @@ const StoryImage: FC = ( { const duration = useSharedValue( undefined ); const isPaused = useDerivedValue( () => paused.value || !isActive.value ); + const loaderHideStyle = useAnimatedStyle( () => ( { + opacity: loading.value ? 1 : 0, + } ) ); + const onImageChange = async () => { if ( !activeStory.value ) { @@ -94,9 +98,9 @@ const StoryImage: FC = ( { return ( <> - + - + {data.data?.source && ( data.isVideo ? (