import { ThemedText } from '@/components/themed-text'; import AntDesign from '@expo/vector-icons/AntDesign'; import React, { useEffect, useRef } from 'react'; import { useTranslation } from 'react-i18next'; import { Animated, TouchableOpacity, View } from 'react-native'; import { styles } from '../styles/welcomeStyle'; import LanguageSelect from './LanguageSelect'; export default function WelcomeHeader({ onMenuPress, menuOpen, }: { onMenuPress: any; menuOpen: boolean; }) { const { t } = useTranslation(); // Icon rotation animatsiyasi const rotateAnim = useRef(new Animated.Value(0)).current; const scaleAnim = useRef(new Animated.Value(1)).current; useEffect(() => { if (menuOpen) { Animated.parallel([ Animated.spring(rotateAnim, { toValue: 1, tension: 100, friction: 8, useNativeDriver: true, }), Animated.sequence([ Animated.timing(scaleAnim, { toValue: 0.8, duration: 100, useNativeDriver: true, }), Animated.spring(scaleAnim, { toValue: 1, tension: 100, friction: 5, useNativeDriver: true, }), ]), ]).start(); } else { Animated.parallel([ Animated.spring(rotateAnim, { toValue: 0, tension: 100, friction: 8, useNativeDriver: true, }), Animated.sequence([ Animated.timing(scaleAnim, { toValue: 0.8, duration: 100, useNativeDriver: true, }), Animated.spring(scaleAnim, { toValue: 1, tension: 100, friction: 5, useNativeDriver: true, }), ]), ]).start(); } }, [menuOpen]); // Rotation interpolation const rotation = rotateAnim.interpolate({ inputRange: [0, 1], outputRange: ['0deg', '90deg'], }); return ( IT {t('common.target')} {menuOpen ? ( ) : ( )} ); }