import { Ionicons } from "@expo/vector-icons"; import { BlurView } from "expo-blur"; import { useRef, useState } from "react"; import { Animated, Easing, Platform, Pressable, TextInput, type TextInputProps, View, } from "react-native"; interface InputProps extends TextInputProps { extraClassName?: string; } export function Input(props: InputProps) { const { style, extraClassName = "", ...otherProps } = props; const inputRef = useRef(null); const [isFocused, setIsFocused] = useState(false); const scale = useRef(new Animated.Value(1)).current; const animateFocus = (focused: boolean) => { Animated.timing(scale, { toValue: focused ? 1.02 : 1, duration: 150, easing: Easing.out(Easing.quad), useNativeDriver: true, }).start(); }; const handleFocus = () => { setIsFocused(true); animateFocus(true); }; const handleBlur = () => { setIsFocused(false); animateFocus(false); }; if (Platform.isTV) { const containerStyle = { height: 48, borderRadius: 50, borderWidth: isFocused ? 1.5 : 1, borderColor: isFocused ? "rgba(255, 255, 255, 0.3)" : "rgba(255, 255, 255, 0.1)", overflow: "hidden" as const, flexDirection: "row" as const, alignItems: "center" as const, paddingLeft: 16, }; const inputElement = ( <> ); return ( inputRef.current?.focus()} onFocus={handleFocus} onBlur={handleBlur} > {Platform.OS === "ios" ? ( {inputElement} ) : ( {inputElement} )} ); } // Mobile version unchanged return ( ); }