import React from 'react'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import * as helpers from '../../helpers'; import Icon from '../../components/Icon'; class Modal extends React.Component { constructor(props) { super(props); } componentDidMount() { $('body').addClass('modal-open'); } componentWillUnmount() { $('body').removeClass('modal-open'); } render() { let className = 'modal'; if (this.props.className) { className += ` ${this.props.className}`; } return (
{this.props.noclose ? null : (
window.history.back()}>
) }
{this.props.children}
); } } const mapStateToProps = (state, ownProps) => ({ shortkeys_enabled: state.ui.shortkeys_enabled, }); const mapDispatchToProps = (dispatch) => ({}); export default connect(mapStateToProps, mapDispatchToProps)(Modal);