import * as React from 'react'; import { ScrollView, ScrollViewProps, StyleProp, StyleSheet, View, ViewStyle, } from 'react-native'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { useExampleTheme } from '.'; type Props = ScrollViewProps & { children: React.ReactNode; withScrollView?: boolean; style?: StyleProp; contentContainerStyle?: StyleProp; }; export default function ScreenWrapper({ children, withScrollView = true, style, contentContainerStyle, ...rest }: Props) { const theme = useExampleTheme(); const insets = useSafeAreaInsets(); const containerStyle = [ styles.container, { backgroundColor: theme.colors.background, paddingBottom: insets.bottom, paddingLeft: insets.left, paddingRight: insets.left, }, ]; return ( <> {withScrollView ? ( {children} ) : ( {children} )} ); } const styles = StyleSheet.create({ container: { flex: 1, }, });