Add no padding Screen option
This commit is contained in:
@@ -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}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
|
|||||||
Reference in New Issue
Block a user