From 83643a78b73dee5610be6ad9837fb72e9b944cb7 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Wed, 28 Aug 2024 15:53:21 +0200 Subject: Initial commit Generated by create-expo-app 3.0.0. --- components/HelloWave.tsx | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 components/HelloWave.tsx (limited to 'components/HelloWave.tsx') diff --git a/components/HelloWave.tsx b/components/HelloWave.tsx new file mode 100644 index 0000000..f4b6ea5 --- /dev/null +++ b/components/HelloWave.tsx @@ -0,0 +1,37 @@ +import { StyleSheet } from 'react-native'; +import Animated, { + useSharedValue, + useAnimatedStyle, + withTiming, + withRepeat, + withSequence, +} from 'react-native-reanimated'; + +import { ThemedText } from '@/components/ThemedText'; + +export function HelloWave() { + const rotationAnimation = useSharedValue(0); + + rotationAnimation.value = withRepeat( + withSequence(withTiming(25, { duration: 150 }), withTiming(0, { duration: 150 })), + 4 // Run the animation 4 times + ); + + const animatedStyle = useAnimatedStyle(() => ({ + transform: [{ rotate: `${rotationAnimation.value}deg` }], + })); + + return ( + + 👋 + + ); +} + +const styles = StyleSheet.create({ + text: { + fontSize: 28, + lineHeight: 32, + marginTop: -6, + }, +}); -- cgit v1.2.3-18-g5258