<commit_before>import React from "react";
import {Paper, TextField, RaisedButton, CircularProgress} from "material-ui";
class SignUp extends React.Component {
  constructor() {
    super();
    this.handleChange = this.handleChange.bind(this);
    this.state = {
      first_name: '',
      last_name: '',
      email: '',
      password: '',
      passwordConfirm: '',
      isLoading: false
    }
  }

  handleChange(e) {
    this.setState({[e.target.name]: e.target.value});
  }

  render() {
    return (
      <Paper zDepth={2}>
        <TextField hintText="First name" onChange={this.handleChange} name='first_name' fullWidth={true}/>
        <TextField hintText="Last name" onChange={this.handleChange} name='last_name' fullWidth={true}/>
        <TextField hintText="Email address" onChange={this.handleChange} name='email' fullWidth={true}/>
        <TextField hintText="Password" onChange={this.handleChange} name='password' type='password' fullWidth={true}/>
        <TextField hintText="Confirm Password" onChange={this.handleChange} name='passwordConfirm' type='password'
                   fullWidth={true}/>
        <RaisedButton label='Sign Up' style={{'display': (this.state.isLoading ? 'none' : 'block')}}/>
        <CircularProgress style={{'display': (!this.state.isLoading ? 'none' : 'block')}}/>
      </Paper>
    );
  }
}

export default SignUp;<commit_msg>add loading button<commit_after>import React from "react";
import {Paper, TextField, RaisedButton, CircularProgress} from "material-ui";
class SignUp extends React.Component {
  constructor() {
    super();
    this.handleChange = this.handleChange.bind(this);
    this.handleClick = this.handleClick.bind(this);
    this.state = {
      first_name: '',
      last_name: '',
      email: '',
      password: '',
      passwordConfirm: '',
      isLoading: false
    }
  }

  handleChange(e) {
    this.setState({[e.target.name]: e.target.value});
  }

  handleClick() {
      this.setState({isLoading: true});
      setTimeout(()=> this.setState({isLoading: false}), 2000);
  }

  render() {
    return (
      <Paper zDepth={2}>
        <TextField hintText="First name" onChange={this.handleChange} name='first_name' fullWidth={true}/>
        <TextField hintText="Last name" onChange={this.handleChange} name='last_name' fullWidth={true}/>
        <TextField hintText="Email address" onChange={this.handleChange} name='email' fullWidth={true}/>
        <TextField hintText="Password" onChange={this.handleChange} name='password' type='password' fullWidth={true}/>
        <TextField hintText="Confirm Password" onChange={this.handleChange} name='passwordConfirm' type='password'
                   fullWidth={true}/>
        <RaisedButton label='Sign Up'
                      style={{'display': (this.state.isLoading ? 'none' : 'block')}}
                      onTouchTap={this.handleClick}/>
        <CircularProgress style={{'display': (!this.state.isLoading ? 'none' : 'block'), margin: 'auto'}}/>
      </Paper>
    );
  }
}

export default SignUp;
{'fraction_non_alphanumeric': 0.15942028985507245, 'fraction_numerical': 0.001976284584980237, 'mean_word_length': 3.446559297218155, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 22, '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': '810601', 'n_tokens_mistral': 893, 'n_tokens_neox': 885, 'n_words': 175}