insomnia/app/ui/components/base/ModalHeader.js
2016-11-28 12:58:41 -08:00

30 lines
667 B
JavaScript

import React, {PropTypes} from 'react';
import classnames from 'classnames';
const ModalHeader = ({hideCloseButton, className, children}) => {
let closeButton = null;
if (!hideCloseButton) {
closeButton = (
<button type="button" className="btn btn--compact modal__close-btn" data-close-modal="true">
<i className="fa fa-times"></i>
</button>
)
}
return (
<div className={classnames('modal__header', className)}>
<div className="modal__header__children">
{children}
</div>
{closeButton}
</div>
);
};
ModalHeader.propTypes = {
hideCloseButton: PropTypes.bool
};
export default ModalHeader;