insomnia/app/ui/components/base/ModalHeader.js
2016-09-16 22:46:44 -07:00

28 lines
590 B
JavaScript

import React, {PropTypes} from 'react';
import classnames from 'classnames';
const ModalHeader = ({hideCloseButton, className, children}) => {
let closeButton = null;
if (!hideCloseButton) {
closeButton = (
<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)}>
{closeButton}
{children}
</div>
);
};
ModalHeader.propTypes = {
hideCloseButton: PropTypes.bool
};
export default ModalHeader;