import React from 'react'; import PropTypes from 'prop-types'; import Portal from './Portal.js'; import Body from './ModalBody.js'; import Header from './ModalHeader.js'; import Footer from './ModalFooter.js'; import Title from './ModalTitle.js'; export const modalSize = { medium: 'md', large: 'l', extraLarge: 'xl', small: 'sm', extraSmall: 'xsm' }; class Modal extends React.Component { render() { const {size, type, children, show} = this.props; return (
{ this.modalRef = el;}}> {show &&
{children}
} {show &&
}
); } } Modal.defaultProps = { show: false, size: 'medium', type: 'info' }; Modal.propTypes = { show: PropTypes.bool, size: PropTypes.string, children: PropTypes.node, type: PropTypes.string }; Modal.Body = Body; Modal.Header = Header; Modal.Footer = Footer; Modal.Title = Title; export default Modal;