import { useScrollToTop } from "expo-router"; import { useRef, type ReactNode } from "react"; import { Platform, ScrollView, type ScrollViewProps, StyleSheet, View } from "react-native"; import { tabLayout } from "@/lib/tab-layout"; import { useTabScreenScrollPadding } from "@/lib/tab-bar-insets"; type TabScrollViewProps = ScrollViewProps & { /** Rendered at the top of scroll content (scrolls with the page). */ header?: ReactNode; children: ReactNode; }; /** * Tab screen scroll view. Top chrome (logo / account) is pinned in TabPage; * the page header and body scroll together here. */ export function TabScrollView({ header, children, contentContainerStyle, style, ...props }: TabScrollViewProps) { const scrollRef = useRef(null); const bottomPadding = useTabScreenScrollPadding(); useScrollToTop(scrollRef); return ( {header} {children} ); } const styles = StyleSheet.create({ scroll: { flex: 1, minHeight: 0, backgroundColor: "transparent", }, });