<commit_before>import React from 'react';
import { connect } from 'react-redux';

import { get } from '../../store';
import BankListItemComponent from './bank';

// State: [{name: bankName, id: bankId}]
class BankListComponent extends React.Component {

    constructor(props) {
        super(props);
        this.state = {
            showDropdown: false
        };
        this.toggleDropdown = this.toggleDropdown.bind(this);
    }

    toggleDropdown(e) {
        this.setState({ showDropdown: !this.state.showDropdown });
        e.preventDefault();
    }

    render() {
        let banks = this.props.accesses.map(access => {
            let isActive = this.props.active === access.id;
            return (
                <BankListItemComponent
                  key={ access.id }
                  access={ access }
                  active={ isActive }
                />
            );
        });

        return (
            <div className="banks sidebar-list">
                <ul className="bank-details">{ banks }</ul>
            </div>
        );
    }
}

const Export = connect(state => {
    return {
        accesses: get.accesses(state),
        active: get.currentAccessId(state)
    };
})(BankListComponent);

export default Export;<commit_msg>Make menu/banks.js a functional component + add prop types<commit_after>import React from 'react';
import { connect } from 'react-redux';

import { get } from '../../store';
import BankListItemComponent from './bank';

const BankListComponent = props => {

    let banks = props.accesses.map(access => {
        let isActive = props.active === access.id;
        return (
            <BankListItemComponent
              key={ access.id }
              access={ access }
              active={ isActive }
            />
        );
    });

    return (
        <div className="banks sidebar-list">
            <ul className="bank-details">{ banks }</ul>
        </div>
    );
};

BankListComponent.propTypes = {
    // The list of bank accesses
    accesses: React.PropTypes.array.isRequired,

    // The id of the current access
    active: React.PropTypes.string.isRequired
};

const Export = connect(state => {
    return {
        accesses: get.accesses(state),
        active: get.currentAccessId(state)
    };
})(BankListComponent);

export default Export;
{'fraction_non_alphanumeric': 0.12784212784212784, 'fraction_numerical': 0.0, 'mean_word_length': 1.9859154929577465, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 18, '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': '221572', 'n_tokens_mistral': 651, 'n_tokens_neox': 629, 'n_words': 151}