<commit_before>import React, {Component, PropTypes} from 'react';
import {connect} from 'react-redux';
import client from 'utils/apiClient';
import {reduxForm} from 'redux-form';
import signupValidation from './signupValidation';
import FormLabelError from '../../../components/ErrorViews/FormLabelError';
import {IndexLink} from 'react-router';
import {Link, hashHistory} from 'react-router';
import Modal from 'react-bootstrap/lib/Modal';

@reduxForm({
  form: 'Signup',
  fields: ['email', 'password', 'eula'],
  validate: signupValidation
})

export default class SignUpForm extends Component {
  constructor(props) {
    super(props);
    this.state = {};
  }

  static propTypes = {
    fields: PropTypes.object.isRequired
  };

  openEula(e) {
    e.preventDefault();
    this.setState({showEula: true})
  }

  closeEula(e) {
    this.setState({showEula: false})
  }

  submit(e) {
    return new Promise((resolve, reject) => {
      client.api.createUser(this.props.fields.email.value, this.props.fields.password.value, 'https://app.storj.io/')
        .then(function success() {
          resolve();
          hashHistory.push('/signup-success');
        },
        function fail(err) {
          if(err && err.message) {
            reject({_error: err.message});
          }
        });
    });
  }

  render() {
    const {fields: {email, password, eula}, error, submitFailed, handleSubmit} = this.props;

    return(
      <div className="container auth">
        {this.renderEula()}
        <div className="row">
          <div className="col-lg-6 col-lg-push-3 col-md-8 col-md-push-2 col-xs-12 text-center">
            <div className="row">
              <div className="col-sm-12">
                <div className="content form-horizontal">

                  <h1 className="title text-center form-group">Sign Up</h1>

                  <form>

                    <div className={"form-group " + (submitFailed && email.error ? "has-error" : "")}>
                      {submitFailed && FormLabelError(email)}
                      <input type="email" className="form-control" name="email" placeholder="Email Address" {...email} />
                    </div>

                    <div className={"form-group " + (submitFailed && password.error ? "has-error" : "")}>
                      {submitFailed && FormLabelError(password)}
                      <input type="password" className="form-control" name="password" placeholder="Password" {...password} />
                    </div>

                    <div className="form-group">
                      <button type="submit" onClick={handleSubmit(this.submit.bind(this))} className='btn btn-block btn-green'>Sign Up</button>
                    </div>

                    <div className="form-group">
                      <label><input type="checkbox" className="text-right" name="eula" {...eula} />I agree to the <a href="#noop" onClick={this.openEula.bind(this)}>Terms of Service</a></label>
                    </div>

                    {error && <div><span className="text-danger">{error}</span></div>}
                    {eula.error && eula.touched && <div><span className="text-danger">{eula.error}</span></div>}
                  </form>
                </div>
                <p>Already have an account? <IndexLink to="/" className="login">Log In</IndexLink></p>
              </div>
            </div>
          </div><commit_msg>Add class to signup checkbox<commit_after>import React, {Component, PropTypes} from 'react';
import {connect} from 'react-redux';
import client from 'utils/apiClient';
import {reduxForm} from 'redux-form';
import signupValidation from './signupValidation';
import FormLabelError from '../../../components/ErrorViews/FormLabelError';
import {IndexLink} from 'react-router';
import {Link, hashHistory} from 'react-router';
import Modal from 'react-bootstrap/lib/Modal';

@reduxForm({
  form: 'Signup',
  fields: ['email', 'password', 'eula'],
  validate: signupValidation
})

export default class SignUpForm extends Component {
  constructor(props) {
    super(props);
    this.state = {};
  }

  static propTypes = {
    fields: PropTypes.object.isRequired
  };

  openEula(e) {
    e.preventDefault();
    this.setState({showEula: true})
  }

  closeEula(e) {
    this.setState({showEula: false})
  }

  submit(e) {
    return new Promise((resolve, reject) => {
      client.api.createUser(this.props.fields.email.value, this.props.fields.password.value, 'https://app.storj.io/')
        .then(function success() {
          resolve();
          hashHistory.push('/signup-success');
        },
        function fail(err) {
          if(err && err.message) {
            reject({_error: err.message});
          }
        });
    });
  }

  render() {
    const {fields: {email, password, eula}, error, submitFailed, handleSubmit} = this.props;

    return(
      <div className="container auth">
        {this.renderEula()}
        <div className="row">
          <div className="col-lg-6 col-lg-push-3 col-md-8 col-md-push-2 col-xs-12 text-center">
            <div className="row">
              <div className="col-sm-12">
                <div className="content form-horizontal">

                  <h1 className="title text-center form-group">Sign Up</h1>

                  <form>

                    <div className={"form-group " + (submitFailed && email.error ? "has-error" : "")}>
                      {submitFailed && FormLabelError(email)}
                      <input type="email" className="form-control" name="email" placeholder="Email Address" {...email} />
                    </div>

                    <div className={"form-group " + (submitFailed && password.error ? "has-error" : "")}>
                      {submitFailed && FormLabelError(password)}
                      <input type="password" className="form-control" name="password" placeholder="Password" {...password} />
                    </div>

                    <div className="form-group">
                      <button type="submit" onClick={handleSubmit(this.submit.bind(this))} className='btn btn-block btn-green'>Sign Up</button>
                    </div>

                    <div className="form-group checkbox">
                      <label><input type="checkbox" className="text-right" name="eula" {...eula} />I agree to the <a href="#noop" onClick={this.openEula.bind(this)}>Terms of Service</a></label>
                    </div>

                    {error && <div><span className="text-danger">{error}</span></div>}
                    {eula.error && eula.touched && <div><span className="text-danger">{eula.error}</span></div>}
                  </form>
                </div>
                <p>Already have an account? <IndexLink to="/" className="login">Log In</IndexLink></p>
              </div>
            </div>
          </div>
{'fraction_non_alphanumeric': 0.15854014598540145, 'fraction_numerical': 0.00291970802919708, 'mean_word_length': 2.2014018691588784, 'pattern_counts': {'":': 0, '<': 89, '<?xml version=': 0, '>': 91, 'https://': 2, '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': '4426907', 'n_tokens_mistral': 1972, 'n_tokens_neox': 1899, 'n_words': 402}