import React from 'react'; import Animated, { interpolate, useAnimatedStyle, } from 'react-native-reanimated'; import { Gradient } from '../Components/Gradient'; import type { Size } from '../types'; type PageShadowProps = { degrees: Animated.SharedValue; viewHeight: number; right: boolean; containerSize: Size; }; const PageShadow: React.FC = ({ degrees, viewHeight, right, containerSize, }) => { const colors = right ? [ 'rgba(0,0,0,0.0)', 'rgba(0,0,0,0.0)', 'rgba(0,0,0,0.2)', 'rgba(0,0,0,0.6)', ] : [ 'rgba(0,0,0,0.6)', 'rgba(0,0,0,0.2)', 'rgba(0,0,0,0.0)', 'rgba(0,0,0,0)', ]; const shadowWidth = containerSize.width * 0.02; const animatedStyle = useAnimatedStyle(() => { const opacity = interpolate( Math.abs(degrees.value), [0, 30, 55, 180], [0, 0, 1, 0] ); return { opacity, }; }); return ( ); }; export default PageShadow;