<commit_before>import React from 'react';
import { observer } from 'mobx-react';
import { action } from 'mobx';
import _ from 'lodash';

const switchTo = action((e, menu) => {
  e.preventDefault();
  _.map(menu, ($val, $key) => _.set(menu, $key, false));
  _.set(menu, e.target.value, true);
});

const Menu = ({ data }) => (
  <div className="menu clearfix">
    <a
      href="https://www.npmjs.com/package/mobx-react-form"
      className="right"
      data-tip="NPM"
    > <i className="fa fa-archive" />
    </a>
    <a
      href="https://github.com/foxhound87/mobx-react-form"
      className="right"
      data-tip="GitHub"
    > <i className="fa fa-github" />
    </a>
    <span className="left label">SELECT DEMO:</span>
    <span className="left">
      <select name="menu" onChange={e => switchTo(e, data)}>
        <option value="withNestedFields">Nested Fields</option>
        <option value="registerMaterial">Register (Material UI)</option>
        <option value="registerSimple">Register (Simple)</option>
        <option value="companyWidgets">Company (React Widgets)</option>
        <option value="companySimple">Company (Simple)</option>
      </select>
    </span>
  </div>
);

Menu.propTypes = {
  data: React.PropTypes.object,
};

export default observer(Menu);
<commit_msg>nested-fields<commit_after>import React from 'react';
import { observer } from 'mobx-react';
import { action } from 'mobx';
import _ from 'lodash';

const switchTo = action((e, menu) => {
  e.preventDefault();
  _.map(menu, ($val, $key) => _.set(menu, $key, false));
  _.set(menu, e.target.value, true);
});

const Menu = ({ data }) => (
  <div className="menu clearfix">
    <a
      href="https://www.npmjs.com/package/mobx-react-form"
      className="right"
      data-tip="NPM"
    > <i className="fa fa-archive" />
    </a>
    <a
      href="https://github.com/foxhound87/mobx-react-form"
      className="right"
      data-tip="GitHub"
    > <i className="fa fa-github" />
    </a>
    <span className="left label">SELECT DEMO:</span>
    <span className="left">
      <select name="menu" onChange={e => switchTo(e, data)}>
        <option value="registerMaterial">Register (Material UI)</option>
        <option value="registerSimple">Register (Simple)</option>
        <option value="companyWidgets">Company (React Widgets)</option>
        <option value="companySimple">Company (Simple)</option>
        <option value="withNestedFields">Nested Fields</option>
      </select>
    </span>
  </div>
);

Menu.propTypes = {
  data: React.PropTypes.object,
};

export default observer(Menu);

{'fraction_non_alphanumeric': 0.17989214175654852, 'fraction_numerical': 0.0015408320493066256, 'mean_word_length': 3.4016949152542373, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 59, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, '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': '747579', 'n_tokens_mistral': 841, 'n_tokens_neox': 836, 'n_words': 176}