import React from 'react'; import PropTypes from 'prop-types'; import { StyleSheet, Platform, useWindowDimensions, View } from 'react-native'; import Modal from 'react-native-modal'; import { BlueSpacing10 } from '../BlueComponents'; import loc from '../loc'; import { useTheme } from './themes'; import Button from './Button'; const styles = StyleSheet.create({ root: { justifyContent: 'flex-end', margin: 0, }, hasDoneButton: { padding: 16, paddingBottom: 24, }, }); const BottomModal = ({ onBackButtonPress = undefined, onBackdropPress = undefined, onClose, windowHeight = undefined, windowWidth = undefined, doneButton = undefined, avoidKeyboard = false, allowBackdropPress = true, ...props }) => { const valueWindowHeight = useWindowDimensions().height; const valueWindowWidth = useWindowDimensions().width; const handleBackButtonPress = onBackButtonPress ?? onClose; const handleBackdropPress = allowBackdropPress ? onBackdropPress ?? onClose : undefined; const { colors } = useTheme(); const stylesHook = StyleSheet.create({ hasDoneButton: { backgroundColor: colors.elevated, }, }); return ( {props.children} {doneButton && (