import React from 'react' import PropTypes from 'prop-types' import Block from '../block' import Button from '../button' import Heading from '../heading' import Text from '../text' class PopoverLayout extends React.PureComponent { handleOnClose = () => { this.props.onClose() } render() { const { children, width, isXS, title, } = this.props if (isXS) { return (
{ !!title &&
{title}
}
{children}
) } return (
{children}
) } } PopoverLayout.propTypes = { children: PropTypes.node, width: PropTypes.number, isXS: PropTypes.bool, title: PropTypes.string, onClose: PropTypes.func, } PopoverLayout.defaultProps = { width: 250, } export default PopoverLayout