<commit_before>import styles from './CloseAboutButton.css';

import React, { Component } from 'react';
import { setAboutVisibilityOption } from '../../actions';

export default class CloseAboutButton extends Component {
    componentDidMount() {
        const { store } = this.context;
        this.unsubscribe = store.subscribe(() => {
            this.forceUpdate();
        })
    }
    componentWillUnmount() {
        this.unsubscribe();
    }
    render() {
        const { store } = this.context;
        return (
            <div
                className={
                    styles.root
                }
                onClick={
                    (e) => {
                        e.stopPropagation();
                        store.dispatch(setAboutVisibilityOption('CLOSE_ABOUT'));
                    }
                }
            >Return
            </div>
        )
    }
}

CloseAboutButton.contextTypes = {
    store: React.PropTypes.object
}<commit_msg>Refactor CloseAboutButton to use 'connect' to receive dispatch<commit_after>import styles from './CloseAboutButton.css';

import React, { Component } from 'react';
import { setAboutVisibilityOption } from '../../actions';
import { connect } from 'react-redux';

export let CloseAboutButton = ({dispatch}) => {
    return (
        <div
            className={
                styles.root
            }
            onClick={
                (e) => {
                    e.stopPropagation();
                    dispatch(setAboutVisibilityOption('CLOSE_ABOUT'));
                }
            }
        >Return
        </div>
    )
}

CloseAboutButton = connect()(CloseAboutButton);
{'fraction_non_alphanumeric': 0.11352657004830918, 'fraction_numerical': 0.0, 'mean_word_length': 1.5610510046367851, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3743955', 'n_tokens_mistral': 413, 'n_tokens_neox': 403, 'n_words': 85}