import React from 'react' import PropTypes from 'prop-types' import { defineMessages, injectIntl } from 'react-intl' import classNames from 'classnames/bind' import Button from '../button' import Block from '../block' import Heading from '../heading' const cx = classNames.bind(_s) class ModalLayout extends React.PureComponent { onHandleCloseModal = () => { this.props.onClose() } render() { const { title, children, intl, width, hideClose, noPadding, isXS, } = this.props const childrenContainerClasses = cx({ default: 1, heightMax80VH: 1, overflowYScroll: 1, px15: !noPadding, py10: !noPadding, }) return (
{title} { !hideClose && !isXS &&
{children}
) } } const messages = defineMessages({ close: { id: 'lightbox.close', defaultMessage: 'Close' }, }) ModalLayout.propTypes = { title: PropTypes.string, children: PropTypes.node, onClose: PropTypes.func.isRequired, width: PropTypes.number, hideClose: PropTypes.bool, noPadding: PropTypes.bool, isXS: PropTypes.bool, } ModalLayout.defaultProps = { width: 600, } export default injectIntl(ModalLayout)