remove loading

This commit is contained in:
Reinaldo Neto 2023-10-04 15:12:55 -03:00
parent 2b379ee281
commit 037a74fb56
2 changed files with 2 additions and 34 deletions

View File

@ -1,32 +0,0 @@
import React, { useEffect } from 'react';
import Animated, { Easing, useAnimatedStyle, useSharedValue, withRepeat, withTiming } from 'react-native-reanimated';
import { CustomIcon } from '../CustomIcon';
import { useTheme } from '../../theme';
const Loading = () => {
const rotation = useSharedValue(0);
const { colors } = useTheme();
useEffect(() => {
rotation.value = withRepeat(
withTiming(360, {
duration: 1000,
easing: Easing.inOut(Easing.linear)
}),
-1
);
}, []);
const animatedStyle = useAnimatedStyle(() => ({
transform: [{ rotate: `${rotation.value}deg` }]
}));
return (
<Animated.View style={[animatedStyle]}>
<CustomIcon name={'loading'} size={24} color={colors.buttonText} />
</Animated.View>
);
};
export default Loading;

View File

@ -4,7 +4,7 @@ import Touchable from '../message/Touchable';
import { CustomIcon } from '../CustomIcon';
import { useTheme } from '../../theme';
import styles from './styles';
import Loading from './Loading';
import RCActivityIndicator from '../ActivityIndicator';
interface IButton {
loading: boolean;
@ -34,7 +34,7 @@ const PlayButton = React.memo(({ loading, paused, onPress, disabled, isReadyToPl
background={Touchable.SelectableBackgroundBorderless()}
>
{loading ? (
<Loading />
<RCActivityIndicator />
) : (
<CustomIcon name={customIconName} size={24} color={disabled ? colors.tintDisabled : colors.buttonFontOnPrimary} />
)}