import * as React from "react"; import { StyleSheet, ScrollView as NativeScrollView, View, StyleProp, ViewStyle, } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import { withTheme } from "../core/theming"; import type { Theme } from "../styles/DefaultTheme"; function ScrollView({ children, style, }: { children: React.ReactNode; style?: StyleProp; }) { return ( {children} ); } type Props = { hasSafeArea: boolean; scrollable: boolean; hasBottomSafeArea?: boolean; hasTopSafeArea?: boolean; theme: Theme; style?: StyleProp; children?: React.ReactNode; }; function ScreenContainer({ hasSafeArea = true, scrollable = true, hasBottomSafeArea, hasTopSafeArea, theme, style, children, ...rest }: Props) { const insets = useSafeAreaInsets(); const paddingTop = hasSafeArea || hasTopSafeArea ? insets.top : 0; const paddingBottom = hasSafeArea || hasBottomSafeArea ? insets.bottom : 0; const backgroundColor = theme.colors.background; return ( {scrollable ? ( {children} ) : ( children )} ); } const styles = StyleSheet.create({ container: { flex: 1, }, }); export default withTheme(ScreenContainer);