import React from 'react'; import { Platform, StyleSheet, useWindowDimensions, View } from 'react-native'; import Modal from 'react-native-modal'; import { BlueSpacing10 } from '../BlueComponents'; import loc from '../loc'; import Button from './Button'; import { useTheme } from './themes'; const styles = StyleSheet.create({ root: { justifyContent: 'flex-end', margin: 0, }, hasDoneButton: { padding: 16, paddingBottom: 24, }, }); interface BottomModalProps { children?: React.ReactNode; onBackButtonPress?: () => void; onBackdropPress?: () => void; onClose: () => void; windowHeight?: number; windowWidth?: number; doneButton?: boolean; avoidKeyboard?: boolean; allowBackdropPress?: boolean; isVisible: boolean; coverScreen?: boolean; } const BottomModal: React.FC = ({ onBackButtonPress, onBackdropPress, onClose, windowHeight, windowWidth, doneButton, isVisible, avoidKeyboard = false, allowBackdropPress = true, coverScreen = true, ...props }) => { const { height: valueWindowHeight, width: valueWindowWidth } = useWindowDimensions(); 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 && (