import React from 'react'; import { Modal as RNModal, View, Text, Pressable, StyleSheet, KeyboardAvoidingView, Platform, ScrollView, } from 'react-native'; import type { DimensionValue } from 'react-native'; import { useTheme } from '../../theme/useTheme'; import type { NovaModalProps, ModalSize } from './Modal.types'; export const NovaModal: React.FC = ({ visible, onClose, size = 'md', title, closeOnBackdrop = true, showCloseButton = true, animationType = 'fade', style, children, }) => { const theme = useTheme(); const sizeMap: Record = { sm: { width: '75%', maxHeight: '50%' }, md: { width: '85%', maxHeight: '70%' }, lg: { width: '92%', maxHeight: '85%' }, full: { width: '100%', maxHeight: '100%' }, }; const { width, maxHeight } = sizeMap[size]; return ( e.stopPropagation()} > {(title || showCloseButton) && ( {title && ( {title} )} {showCloseButton && ( )} )} {children} ); }; const styles = StyleSheet.create({ keyboardView: { flex: 1, }, backdrop: { flex: 1, justifyContent: 'center', alignItems: 'center', }, container: { overflow: 'hidden', }, header: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', }, closeBtn: { padding: 4, }, });