insomnia/app/components/base/ModalHeader.js

28 lines
590 B
JavaScript
Raw Normal View History

2016-07-20 18:35:08 +00:00
import React, {PropTypes} from 'react';
import classnames from 'classnames';
2016-04-15 05:23:54 +00:00
2016-07-20 18:35:08 +00:00
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
};
2016-04-15 05:23:54 +00:00
export default ModalHeader;