From 9759ae19b73572f49ef2b584bd191d7d9b0d4582 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Tue, 1 Oct 2024 13:43:23 +0300 Subject: [PATCH] use util_screen_outer --- src/components/Layout.tsx | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index e6d90c1213..49d6b8dbab 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -1,7 +1,10 @@ import React from 'react' -import {View} from 'react-native' +import {View, ViewStyle} from 'react-native' +import {StyleProp} from 'react-native' import {useSafeAreaInsets} from 'react-native-safe-area-context' +import {atoms as a} from '#/alf' + // Every screen should have a Layout component wrapping it. // This component provides a default padding for the top of the screen. // This allows certain screens to avoid @@ -9,16 +12,29 @@ import {useSafeAreaInsets} from 'react-native-safe-area-context' // In a future PR I will add a unified header component to this file and // things like a preconfigured scrollview. +/** + * Every screen should have a Layout.Screen component wrapping it. + * This component provides a default padding for the top of the screen + * and height/minHeight + */ let Screen = ({ - children, disableTopPadding, -}: { - children: React.ReactNode + style, + ...props +}: React.ComponentProps & { disableTopPadding?: boolean + style?: StyleProp }): React.ReactNode => { const {top} = useSafeAreaInsets() return ( - {children} + ) } Screen = React.memo(Screen)