import type { ReactNode } from 'react'; import { ScrollView, StyleSheet, View, type ScrollViewProps, type StyleProp, type ViewStyle, } from 'react-native'; import { useTheme } from '@/theme/theme-provider'; import { spacing } from '@/theme/tokens'; export interface ScreenProps { children: ReactNode; /** Wrap in a ScrollView (default false — lists bring their own). */ scroll?: boolean; /** Apply horizontal screen padding (default true). */ padded?: boolean; /** Optional pull-to-refresh control forwarded to the ScrollView. */ refreshControl?: ScrollViewProps['refreshControl']; contentContainerStyle?: StyleProp; style?: StyleProp; } /** Base screen container: themed background, consistent padding, optional scroll. */ export function Screen({ children, scroll = false, padded = true, refreshControl, contentContainerStyle, style, }: ScreenProps) { const { colors } = useTheme(); const padding = padded ? spacing.lg : 0; if (scroll) { return ( {children} ); } return ( {children} ); } /** Standard vertical gap between stacked screen sections. */ export const SECTION_GAP = spacing.lg; const styles = StyleSheet.create({ flex: { flex: 1 }, scrollContent: { gap: spacing.lg }, });