import React, { ReactChild } from "react"; import Modal, { Props } from "react-modal"; import { useThemeUI, Close } from "theme-ui"; type ModalProps = Props & { children: ReactChild | ReactChild[], allowClose: boolean } function StyledModal({ isOpen, onRequestClose, children, allowClose, style, ...props }: ModalProps ) { const { theme } = useThemeUI(); return ( {children} {allowClose && ( )} ); } StyledModal.defaultProps = { allowClose: true, style: {} }; export default StyledModal;