import { useMemo } from "react"; import { useSafeAreaInsets } from "react-native-safe-area-context"; const BASE_PADDING = 16; /** * Bottom padding for scroll containers on stack screens (no tab bar below). * Android is edge-to-edge, so without this the last item scrolls under the * gesture/navigation bar — found.md: the first post on a pet profile sat in * the gesture area and couldn't be tapped. Same idea as comments.tsx / * messages/[conversationId].tsx, which pass insets.bottom into makeStyles. * * Usage: `contentContainerStyle={[styles.list, bottomPadding]}`. */ export function useBottomSafePadding(base: number = BASE_PADDING) { const { bottom } = useSafeAreaInsets(); return useMemo(() => ({ paddingBottom: base + bottom }), [base, bottom]); }