2018-07-05 09:59:42 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { PropTypes } from 'prop-types';
|
|
|
|
import './style.scss';
|
|
|
|
|
|
|
|
const Modal = props => (
|
|
|
|
<div className={`modal ${props.isModalOpen ? 'modal-open' : ''} ${props.modalOnMobileOnly ? 'modal-on-mobile-only' : ''} `}>
|
|
|
|
<div className="modal-inner">
|
2018-07-05 11:57:00 +00:00
|
|
|
{ props.children }
|
2018-07-05 09:59:42 +00:00
|
|
|
<div role="button" tabIndex="0" onClick={props.closeModal} className="modal-close">x</div> {/* eslint-disable-line */}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
|
|
|
Modal.propTypes = {
|
|
|
|
isModalOpen: PropTypes.bool.isRequired,
|
|
|
|
children: PropTypes.shape({}).isRequired,
|
|
|
|
closeModal: PropTypes.func.isRequired,
|
|
|
|
modalOnMobileOnly: PropTypes.bool,
|
|
|
|
};
|
|
|
|
|
|
|
|
Modal.defaultProps = {
|
|
|
|
modalOnMobileOnly: false,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Modal;
|