From f914d76094eb1f1b02c4f9fcab3844d46c22f7de Mon Sep 17 00:00:00 2001 From: GleidsonDaniel Date: Wed, 22 Dec 2021 18:29:36 -0300 Subject: [PATCH] fix: add height verification to fix modal dimension --- .../MasterDetailStack/ModalContainer.tsx | 28 +++++++++++++------ 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/app/stacks/MasterDetailStack/ModalContainer.tsx b/app/stacks/MasterDetailStack/ModalContainer.tsx index aeea3d88cd..376ff87695 100644 --- a/app/stacks/MasterDetailStack/ModalContainer.tsx +++ b/app/stacks/MasterDetailStack/ModalContainer.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { StyleSheet, TouchableWithoutFeedback, View } from 'react-native'; +import { StyleSheet, TouchableWithoutFeedback, useWindowDimensions, View } from 'react-native'; import { StackNavigationProp } from '@react-navigation/stack'; import { NavigationContainerProps } from '@react-navigation/core'; @@ -23,11 +23,21 @@ const styles = StyleSheet.create({ } }); -export const ModalContainer = ({ navigation, children, theme }: IModalContainer): JSX.Element => ( - - navigation.pop()}> - - - {children} - -); +export const ModalContainer = ({ navigation, children, theme }: IModalContainer): JSX.Element => { + const { height } = useWindowDimensions(); + const modalHeight = sharedStyles.modalFormSheet.height; + return ( + + navigation.pop()}> + + + height ? height : modalHeight + }}> + {children} + + + ); +};