Add no padding Screen option

This commit is contained in:
Eric Bailey
2024-12-08 14:48:50 -06:00
parent 36b01417c2
commit 0422071844
+7 -1
View File
@@ -21,6 +21,7 @@ export * as Header from '#/components/Layout/Header'
export type ScreenProps = React.ComponentProps<typeof View> & {
style?: StyleProp<ViewStyle>
noPaddingTop?: boolean
}
/**
@@ -28,6 +29,7 @@ export type ScreenProps = React.ComponentProps<typeof View> & {
*/
export const Screen = React.memo(function Screen({
style,
noPaddingTop,
...props
}: ScreenProps) {
const {top} = useSafeAreaInsets()
@@ -35,7 +37,11 @@ export const Screen = React.memo(function Screen({
<>
{isWeb && <WebCenterBorders />}
<View
style={[a.util_screen_outer, {paddingTop: top}, style]}
style={[
a.util_screen_outer,
{paddingTop: noPaddingTop ? 0 : top},
style,
]}
{...props}
/>
</>