import {Pressable} from 'react-native' import Animated, { Extrapolation, interpolate, type SharedValue, useAnimatedProps, useAnimatedStyle, } from 'react-native-reanimated' import {BlurView} from 'expo-blur' import {msg} from '@lingui/macro' import {useLingui} from '@lingui/react' import {atoms as a, useTheme} from '#/alf' import {useContextMenuContext} from './context' const AnimatedBlurView = Animated.createAnimatedComponent(BlurView) type Props = { animation: SharedValue intensity?: number onPress?: () => void } export function Backdrop(props: Props) { const {mode} = useContextMenuContext() switch (mode) { case 'full': return case 'auxiliary-only': return } } function BlurredBackdrop({animation, intensity = 50, onPress}: Props) { const {_} = useLingui() const animatedProps = useAnimatedProps(() => ({ intensity: interpolate( animation.get(), [0, 1], [0, intensity], Extrapolation.CLAMP, ), })) return ( ) } function OpacityBackdrop({animation, onPress}: Props) { const t = useTheme() const {_} = useLingui() const animatedStyle = useAnimatedStyle(() => ({ opacity: interpolate( animation.get(), [0, 1], [0, 0.05], Extrapolation.CLAMP, ), })) return ( ) }