<commit_before>import React, {Component} from 'react';
import PropTypes from 'prop-types';
import {connect} from 'react-redux';
import AutoBind from 'auto-bind-es5';

import {toggleModal, sendCart} from '../store/actions/cart';
import CartList from '../components/CartList';

class CartContainer extends Component {
    constructor(props) {
        super(props);
        AutoBind(this);
    }
    render() {
        if (this.props.visible) return <div />;
        return (
            <div className="modal is-active">
                <div className="modal-background" onClick={toggleModal} />
                <div className="modal-card">
                    <header className="modal-card-head">
                        <p className="modal-card-title">Saved items</p>
                        <button className="modal-close" onClick={toggleModal} />
                    </header>
                    <section className="modal-card-body">
                        <CartList />
                        <hr/>
                        <div className="field">
                            <p className="control">
                                <textarea
                                    className="textarea"
                                    placeholder="Additionnal informations..."
                                    ref={el => this.message = el}
                                />
                            </p>
                        </div>
                    </section>
                    <footer className="modal-card-foot">
                        <a className="button is-success" onClick={() => sendCart(this.message.value)}>Send this order</a>
                        <a className="button is-outline" disabled onClick={() => console.log('reset')}>Empty cart</a>
                    </footer>
                </div>
            </div>
        );
    }
}

CartContainer.propTypes = {
    visible: PropTypes.bool
};

export default connect(state => ({
    visible: state.cart.isVisible
}))(CartContainer);
<commit_msg>fixed wrong cart visibility<commit_after>import React, {Component} from 'react';
import PropTypes from 'prop-types';
import {connect} from 'react-redux';
import AutoBind from 'auto-bind-es5';

import {toggleModal, sendCart} from '../store/actions/cart';
import CartList from '../components/CartList';

class CartContainer extends Component {
    constructor(props) {
        super(props);
        AutoBind(this);
    }
    render() {
        if (!this.props.visible) return null;
        return (
            <div className="modal is-active">
                <div className="modal-background" onClick={toggleModal} />
                <div className="modal-card">
                    <header className="modal-card-head">
                        <p className="modal-card-title">Saved items</p>
                        <button className="modal-close" onClick={toggleModal} />
                    </header>
                    <section className="modal-card-body">
                        <CartList />
                        <hr/>
                        <div className="field">
                            <p className="control">
                                <textarea
                                    className="textarea"
                                    placeholder="Additionnal informations..."
                                    ref={el => this.message = el}
                                />
                            </p>
                        </div>
                    </section>
                    <footer className="modal-card-foot">
                        <a className="button is-success" onClick={() => sendCart(this.message.value)}>Send this order</a>
                        <a className="button is-outline" disabled onClick={() => console.log('reset')}>Empty cart</a>
                    </footer>
                </div>
            </div>
        );
    }
}

CartContainer.propTypes = {
    visible: PropTypes.bool
};

export default connect(state => ({
    visible: state.cart.isVisible
}))(CartContainer);

{'fraction_non_alphanumeric': 0.12247909493359567, 'fraction_numerical': 0.0004918839153959665, 'mean_word_length': 1.3617886178861789, 'pattern_counts': {'":': 0, '<': 54, '<?xml version=': 0, '>': 62, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5280239', 'n_tokens_mistral': 964, 'n_tokens_neox': 923, 'n_words': 207}