import React from 'react'; import PropTypes from 'prop-types'; import Icon from './Icon'; function Modal(props) { // The gray background const backdropStyle = { position: 'fixed', top: 0, bottom: 0, left: 0, right: 0, backgroundColor: 'rgba(0, 0, 0, 0.3)', padding: 50 }; return props.show ? (
{props.children}
) : (null); } export default React.memo(Modal); Modal.propTypes = { onClose: PropTypes.func.isRequired, show: PropTypes.bool, children: PropTypes.node };