import { Component, ReactNode } from 'react'; import ReactModal from 'react-modal'; import classnames from 'classnames'; import injectCSS, { WithStylesProps } from 'react-jss'; import { mdiClose } from '@mdi/js'; import Icon from '../icon'; import styles from './styles'; interface IProps extends WithStylesProps { children: ReactNode; isOpen: boolean; close: () => void; className?: string | null; portal?: string; shouldCloseOnOverlayClick?: boolean; showClose?: boolean; } class Modal extends Component { render() { const { children, classes, isOpen, close, className = null, portal = 'modal-portal', shouldCloseOnOverlayClick = false, showClose = true, } = this.props; return ( {showClose && close && ( )}
{children}
); } } export default injectCSS(styles)(Modal);