({
children,
withScrollView = true,
style,
contentContainerStyle,
...rest
}: Props)
| 20 | }; |
| 21 | |
| 22 | export default function ScreenWrapper({ |
| 23 | children, |
| 24 | withScrollView = true, |
| 25 | style, |
| 26 | contentContainerStyle, |
| 27 | ...rest |
| 28 | }: Props) { |
| 29 | const theme = useExampleTheme(); |
| 30 | |
| 31 | const insets = useSafeAreaInsets(); |
| 32 | |
| 33 | const containerStyle = [ |
| 34 | styles.container, |
| 35 | { |
| 36 | backgroundColor: theme.colors.background, |
| 37 | paddingBottom: insets.bottom, |
| 38 | paddingLeft: insets.left, |
| 39 | paddingRight: insets.left, |
| 40 | }, |
| 41 | ]; |
| 42 | |
| 43 | return ( |
| 44 | <> |
| 45 | {withScrollView ? ( |
| 46 | <ScrollView |
| 47 | {...rest} |
| 48 | contentContainerStyle={contentContainerStyle} |
| 49 | keyboardShouldPersistTaps="always" |
| 50 | alwaysBounceVertical={false} |
| 51 | showsVerticalScrollIndicator={false} |
| 52 | style={[containerStyle, style]} |
| 53 | > |
| 54 | {children} |
| 55 | </ScrollView> |
| 56 | ) : ( |
| 57 | <View style={[containerStyle, style]}>{children}</View> |
| 58 | )} |
| 59 | </> |
| 60 | ); |
| 61 | } |
| 62 | |
| 63 | const styles = StyleSheet.create({ |
| 64 | container: { |
nothing calls this directly
no test coverage detected
searching dependent graphs…