insomnia/app/components/base/ModalHeader.js
2016-07-20 11:35:08 -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;