import React, {PropTypes, PureComponent} from 'react'; import classnames from 'classnames'; class ModalHeader extends PureComponent { render () { const {hideCloseButton, className, children} = this.props; let closeButton = null; if (!hideCloseButton) { closeButton = ( ); } return (
{children}
{closeButton}
); } } ModalHeader.propTypes = { // Required children: PropTypes.node.isRequired, // Optional hideCloseButton: PropTypes.bool, className: PropTypes.string }; export default ModalHeader;