mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 14:49:53 +00:00
b198e6170b
* Removed some unnecessary rendering * Only PureComponents and some other stuff * Removed all functional components * Only deal with nunjucks marks * Remove ref assign functions in modals * Lots of tweaks * A bit snappier * A bit snappier
33 lines
770 B
JavaScript
33 lines
770 B
JavaScript
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 = (
|
|
<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;
|