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> & { export type ScreenProps = React.ComponentProps<typeof View> & {
style?: StyleProp<ViewStyle> style?: StyleProp<ViewStyle>
noPaddingTop?: boolean
} }
/** /**
@@ -28,6 +29,7 @@ export type ScreenProps = React.ComponentProps<typeof View> & {
*/ */
export const Screen = React.memo(function Screen({ export const Screen = React.memo(function Screen({
style, style,
noPaddingTop,
...props ...props
}: ScreenProps) { }: ScreenProps) {
const {top} = useSafeAreaInsets() const {top} = useSafeAreaInsets()
@@ -35,7 +37,11 @@ export const Screen = React.memo(function Screen({
<> <>
{isWeb && <WebCenterBorders />} {isWeb && <WebCenterBorders />}
<View <View
style={[a.util_screen_outer, {paddingTop: top}, style]} style={[
a.util_screen_outer,
{paddingTop: noPaddingTop ? 0 : top},
style,
]}
{...props} {...props}
/> />
</> </>