import React, { forwardRef } from 'react'; import { Animated, FlatList } from 'react-native'; import type { AnimatedFlatListViewProps } from '../types'; import AnimatedNavbar from './AnimatedNavbar'; import { HEADER_HEIGHT, IMG_HEADER_HEIGHT } from '../constants'; import { useAnimateScrollView } from '../hooks/useAnimateScrollView'; import { AnimatedHeader } from './AnimatedHeader'; export const AnimatedFlatList = forwardRef( ( { headerMaxHeight, topBarHeight, topBarElevation, disableScale, TopNavBarComponent, HeaderNavbarComponent, headerImage, imageStyle, HeaderComponent, ...props }: AnimatedFlatListViewProps, ref ) => { const imageHeight = headerMaxHeight || IMG_HEADER_HEIGHT; const headerNavHeight = topBarHeight || HEADER_HEIGHT; const headerElevation = topBarElevation || 0; const [scroll, onScroll, scale, translateYDown, translateYUp] = useAnimateScrollView(imageHeight, disableScale); return ( <> } /> ); } );