import GradientBackground from '@app/components/GradientBackground' import colors from '@app/styles/colors' import dimensions from '@app/styles/dimensions' import React, { ForwardedRef, PropsWithChildren } from 'react' import { ScrollView, ScrollViewProps, useWindowDimensions } from 'react-native' import Animated from 'react-native-reanimated' import { useSafeAreaInsets } from 'react-native-safe-area-context' export type GradientScrollViewProps = PropsWithChildren< Animated.AnimateProps & { offset?: number } > const GradientScrollView = React.forwardRef((props, ref) => { const layout = useWindowDimensions() const paddingTop = useSafeAreaInsets().top const minHeight = layout.height - (dimensions.header + paddingTop + dimensions.bottom()) return ( } overScrollMode="never" {...props} style={[props.style, { backgroundColor: colors.gradient.low }]} contentContainerStyle={[props.contentContainerStyle as any, { minHeight }]}> {props.children} ) }) export default GradientScrollView