<commit_before>var details = {
    name : "Name",
    workPhone : "workPhone",
    email : "Email",
    homePhone : "homePhone",
    mobile : "Mobile"}

var ContactField = React.createClass({
    render: function() {
        return (
            <div>
                <p>
                    {this.props.details.name}
                    <input type="text"/>
                </p>
                <p>
                    {this.props.details.email}
                    <input type="text"/>
                </p>
                <p>
                    {this.props.details.workPhone}
                    <input type="text"/>
                </p>
                <p>
                    {this.props.details.homePhone}
                    <input type="text"/>
                </p>
                <p>
                    {this.props.details.mobile}
                    <input type="text"/>
                </p>
            </div>
        );
    }
});

ReactDOM.render(
    <ContactField details = {details}/>, document.getElementById('contact'));<commit_msg>Created editable contact fields<commit_after>var details = {
    name : "Name",
    workPhone : "workPhone",
    email : "Email",
    homePhone : "homePhone",
    mobile : "Mobile"}

var ContactField = React.createClass({
  getInitialState: function() {
        return {editing: false}
    },
  save: function() {
      this.props.content = ReactDOM.findDOMNode(this.refs.newText).value;
      this.setState({editing: false});
  },
  edit: function() {
        this.setState({editing: true});
  },
  renderDisplay: function() {
        return (
            <div className="field">
                <p>{this.props.fieldName} : {this.props.content}</p>
                <span>
                    <button onClick={this.edit}>Edit</button>
               </span>
            </div>
            );
  },
  renderForm: function() {
        return (
            <div className="field">
            <p>{this.props.fieldName}</p>
            <input type="text" ref="newText" defaultValue={this.props.content} 
            className="form-control"></input>
            <button onClick={this.save}>Save</button>
            </div>
            )
  },
  render: function() {
        if (this.state.editing) {
            return this.renderForm();
        }
        else {
            return this.renderDisplay();
        }
    }
});

ReactDOM.render(
    <ContactField fieldName="Name" content=""/>, document.getElementById('contact'));
{'fraction_non_alphanumeric': 0.1443590780428629, 'fraction_numerical': 0.0, 'mean_word_length': 1.4543650793650793, 'pattern_counts': {'":': 0, '<': 38, '<?xml version=': 0, '>': 38, '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': '4847229', 'n_tokens_mistral': 687, 'n_tokens_neox': 665, 'n_words': 122}