<commit_before>import './AddressList.less';
import AddrLine from './AddrLine.react';
import React, { PropTypes } from 'react';
import Component from 'react-pure-render/component';
import { connect } from 'react-redux';

class AddressList extends Component {

  static propTypes = {
    addresses: PropTypes.object.isRequired,
    msg: PropTypes.object,
  };

  render() {
    const { addresses, msg } = this.props;

    return (
      <section className="device-switch-list">
        {addresses.map(address =>
          <AddrLine {...{ msg, address }} key={address.id} />
         )
        }
      </section>
    );
  }
}

export default connect(state => ({
  msg: state.intl.msg.home, /* PENDING: don't use this, create your own subtree in en.js */
}))(AddressList);<commit_msg>Sort addresses on home-screen by name and value.<commit_after>import './AddressList.less';
import AddrLine from './AddrLine.react';
import React, { PropTypes } from 'react';
import Component from 'react-pure-render/component';
import { connect } from 'react-redux';

class AddressList extends Component {

  static propTypes = {
    addresses: PropTypes.object.isRequired,
    msg: PropTypes.object,
  };

  render() {
    const { addresses, msg } = this.props;

    return (
      <section className="device-switch-list">
        {addresses.sortBy(addr => addr.name)
                  .sortBy(addr => !addr.value)
                  .map(address =>
                    <AddrLine {...{ msg, address }} key={address.id} />
                  )
        }
      </section>
    );
  }
}

export default connect(state => ({
  msg: state.intl.msg.home, /* PENDING: don't use this, create your own subtree in en.js */
}))(AddressList);
{'fraction_non_alphanumeric': 0.14361078546307152, 'fraction_numerical': 0.0, 'mean_word_length': 2.670967741935484, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, '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': '4764583', 'n_tokens_mistral': 509, 'n_tokens_neox': 502, 'n_words': 128}