import React from 'react'; import { StyleSheet, TouchableWithoutFeedback, useWindowDimensions, View } from 'react-native'; import { StackNavigationProp } from '@react-navigation/stack'; import { NavigationContainerProps } from '@react-navigation/core'; import sharedStyles from '../../views/Styles'; import { themes } from '../../constants/colors'; interface IModalContainer extends NavigationContainerProps { navigation: StackNavigationProp; children: React.ReactNode; theme: string; } const styles = StyleSheet.create({ root: { flex: 1, alignItems: 'center', justifyContent: 'center' }, backdrop: { ...StyleSheet.absoluteFillObject } }); export const ModalContainer = ({ navigation, children, theme }: IModalContainer): JSX.Element => { const { height } = useWindowDimensions(); const modalHeight = sharedStyles.modalFormSheet.height; return ( navigation.pop()}> height ? height : modalHeight }}> {children} ); };