import { View, Image, Text, TouchableOpacity } from "react-native"; import styles from "@/app/stackStyles/participantStyles"; import Ionicons from "@expo/vector-icons/Ionicons"; import React, { useCallback, useMemo, useRef, useEffect, useState, } from "react"; import { router } from "expo-router"; import Feather from "@expo/vector-icons/Feather"; import BottomSheet, { BottomSheetScrollView } from "@gorhom/bottom-sheet"; import { ScrollView, GestureHandlerRootView, } from "react-native-gesture-handler"; import { useShowContext } from "@/contexts/ShowContext"; import Animated, { useSharedValue, useAnimatedStyle, withTiming, withRepeat, withSequence, Easing, cancelAnimation, } from "react-native-reanimated"; export default function ParticipantScreen() { const { shows, error, loading } = useShowContext(); const bottomSheetRef = useRef(null); const [sheetIndex, setSheetIndex] = useState(1); const handleSheetChange = useCallback((index: number) => { setSheetIndex(index); }, []); const snapPoints = useMemo(() => ["10%", "10%", "45%"], []); const bounce = useSharedValue(0); const expanded = useSharedValue(0); useEffect(() => { if (sheetIndex === 2) { cancelAnimation(bounce); expanded.value = withTiming(1, { duration: 120 }); bounce.value = withTiming(-12, { duration: 120 }); } else { expanded.value = withTiming(0, { duration: 100 }); bounce.value = withRepeat( withSequence( withTiming(-6, { duration: 250, easing: Easing.out(Easing.quad) }), withTiming(0, { duration: 250, easing: Easing.inOut(Easing.quad) }) ), -1, true ); } return () => { cancelAnimation(bounce); }; }, [sheetIndex, bounce, expanded]); const iconAnimatedStyle = useAnimatedStyle(() => ({ transform: [ { translateY: bounce.value }, { rotate: `${expanded.value * 180}deg` }, ], opacity: 1 - expanded.value * 0.3, })); return ( Calvin Ogara router.back()} > Single 24 Jahre Köln Auftritte: {shows.map((show, i) => ( ))} ); }