import React from 'react'; import { RefreshControl, Platform, StyleSheet, View, StatusBar } from 'react-native'; import { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context'; import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'; import { useAppTheme } from '../context/ThemeContext'; import { useRefresh } from '../context/RefreshContext'; interface AppScreenProps { children: React.ReactNode; scrollable?: boolean; onRefresh?: () => Promise; containerStyle?: any; } export const AppScreen = ({ children, scrollable = true, onRefresh, containerStyle }: AppScreenProps) => { const { colors, isDark } = useAppTheme(); const { refreshing, refreshAll } = useRefresh(); const insets = useSafeAreaInsets(); const handleRefresh = async () => { await refreshAll(); if (onRefresh) { await onRefresh(); } }; const bg = isDark ? '#111111' : '#F5F5F5'; const content = ( } > {children} ); return ( {/* Handling top padding manually for more control than default SafeAreaView */} {scrollable ? content : {children}} ); }; const styles = StyleSheet.create({ container: { flex: 1, }, webMaxWidth: { width: '100%', backgroundColor: 'transparent', } });