@@ -10,6 +10,8 @@ import { ScrollView, View } from 'react-native';
1010
1111import styled from 'styled-components' ;
1212
13+ import { spacing } from '@/constants' ;
14+
1315import { DarkTheme , DefaultTheme } from '@react-navigation/native' ;
1416
1517export const ReactNavigationDarkTheme = {
@@ -34,20 +36,15 @@ export const ReactNavigationLightTheme = {
3436 },*/
3537} ;
3638
37- export const StyledView = styled ( View ) `
38- background-color: ${ props => props . theme . colors . background } ;
39- color: ${ props => props . theme . colors . onBackground } ;
40- flex: 1;
41- align-items: center;
42- justify-content: center;
43- width: 100%;
44- ` ;
45-
4639export interface StyledScrollViewProps extends ScrollViewProps {
4740 theme : MD3Theme ;
41+ disableSafeBottomMargin ?: boolean ;
4842}
4943
50- export const StyledScrollView : FC < StyledScrollViewProps > = props => {
44+ export const StyledScrollView : FC < StyledScrollViewProps > = ( {
45+ children,
46+ ...props
47+ } ) => {
5148 const rnpTheme = useTheme ( ) ;
5249 const theme = props . theme ?? rnpTheme ;
5350
@@ -60,21 +57,32 @@ export const StyledScrollView: FC<StyledScrollViewProps> = props => {
6057 color : theme . colors . onBackground ,
6158 width : '100%' ,
6259 } }
63- />
60+ >
61+ { children }
62+ { props . disableSafeBottomMargin ? null : (
63+ < View style = { { height : spacing * 2 } } />
64+ ) }
65+ </ ScrollView >
6466 ) ;
6567} ;
6668
6769export type StyledSafeAreaViewProps = {
6870 theme ?: MD3Theme ;
71+ enableSafeBottomMargin ?: boolean ;
6972} & SafeAreaViewProps ;
7073
71- const InternalStyledSafeAreaView = styled ( SafeAreaView ) < { theme : MD3Theme } > `
74+ const InternalStyledSafeAreaView = styled ( SafeAreaView ) < {
75+ theme : MD3Theme ;
76+ enableSafeBottomMargin ?: boolean ;
77+ } > `
7278 height: 100%;
7379 flex: 1;
7480 align-items: center;
7581 background-color: ${ props => props . theme . colors . background } ;
7682 display: flex;
7783 color: ${ props => props . theme . colors . onBackground } ;
84+ padding-bottom: ${ props =>
85+ props . enableSafeBottomMargin ? spacing * 2 : 0 } px;
7886` ;
7987
8088export const StyledSafeAreaView : FC < StyledSafeAreaViewProps > = props => {
0 commit comments