<commit_before>import Joi from 'joi';
import RaisedButton from 'material-ui/RaisedButton';
import React from 'react';
import Paper from 'material-ui/Paper';
import TextField from 'material-ui/TextField';

const LoginForm = React.createClass({
  getInitialState() {
    return {
      errors: {},
      credentials: {
        email: '',
        password: ''
      }
    }
  },

  handleChange(event) {
    const { name, value } = event.target;
    const nextCredentials = Object.assign({}, this.state.credentials, {
      [name]: value
    });

    this.setState({ credentials: nextCredentials });
  },

  handleTouchTap() {
    this.props.login(this.state.credentials);
  },

  handleFocus(event) {
    if (event.target.tagName === 'INPUT') {
      document.getElementById('footer').style.display = "none";
    };
  },

  handleBlur() {
    if (document.activeElement.nodeName === 'BODY') {
      document.getElementById('footer').style.display = "inline-block";
    };
  },

  render() {
    const styleContainer = {
      // height: '70vh',
      display: 'flex',
      flexDirection: 'column',
      alignItems: 'center',
      justifyContent: 'center',
      marginTop: '80px'
    };

    const styleTextField = {
      marginBottom: '10px'
    }

    const styleButton = {
      width: '100px',
      marginTop: '20px'
    };

    const styleLabel = {
      borderColor: '#ff7f66'
    };

    const { credentials } = this.state;

    return <div style={styleContainer}>

      <TextField
        placeholder="Email"
        name="email"
        onChange={this.handleChange}
        onFocus={this.handleFocus}
        onBlur={this.handleBlur}
        style={styleTextField}
        underlineFocusStyle={styleLabel}
        type="email"
        value={credentials.email}
      />

      <TextField
        placeholder="Password"
        name="password"
        onChange={this.handleChange}
        onFocus={this.handleFocus}
        onBlur={this.handleBlur}
        underlineFocusStyle={styleLabel}
        type="password"
        value={credentials.password}
      />

      <RaisedButton
        primary={true}
        label="Login"
        onTouchTap={this.handleTouchTap}
        style={styleButton}
      />

    </div>
  }
})

export default LoginForm;
<commit_msg>Close #95 Lint LoginForm.jsx<commit_after>import RaisedButton from 'material-ui/RaisedButton';
import React from 'react';
import TextField from 'material-ui/TextField';

const LoginForm = React.createClass({
  getInitialState() {
    return {
      errors: {},
      credentials: {
        email: '',
        password: ''
      }
    };
  },

  handleChange(event) {
    const { name, value } = event.target;
    const nextCredentials = Object.assign({}, this.state.credentials, {
      [name]: value
    });

    this.setState({ credentials: nextCredentials });
  },

  handleTouchTap() {
    this.props.login(this.state.credentials);
  },

  handleFocus(event) {
    if (event.target.tagName === 'INPUT') {
      document.getElementById('footer').style.display = 'none';
    }
  },

  handleBlur() {
    if (document.activeElement.nodeName === 'BODY') {
      document.getElementById('footer').style.display = 'inline-block';
    }
  },

  render() {
    const styleContainer = {
      // height: '70vh',
      display: 'flex',
      flexDirection: 'column',
      alignItems: 'center',
      justifyContent: 'center',
      marginTop: '80px'
    };

    const styleTextField = {
      marginBottom: '10px'
    };

    const styleButton = {
      width: '100px',
      marginTop: '20px'
    };

    const styleLabel = {
      borderColor: '#ff7f66'
    };

    const { credentials } = this.state;

    return <div style={styleContainer}>

      <TextField
        name="email"
        onBlur={this.handleBlur}
        onChange={this.handleChange}
        onFocus={this.handleFocus}
        placeholder="Email"
        style={styleTextField}
        type="email"
        underlineFocusStyle={styleLabel}
        value={credentials.email}
      />

      <TextField
        name="password"
        onBlur={this.handleBlur}
        onChange={this.handleChange}
        onFocus={this.handleFocus}
        placeholder="Password"
        type="password"
        underlineFocusStyle={styleLabel}
        value={credentials.password}
      />

      <RaisedButton
        label="Login"
        onTouchTap={this.handleTouchTap}
        primary={true}
        style={styleButton}
      />

    </div>;
  }
});

export default LoginForm;

{'fraction_non_alphanumeric': 0.13546524539196092, 'fraction_numerical': 0.006662225183211193, 'mean_word_length': 2.409538228614686, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '4304535', 'n_tokens_mistral': 1368, 'n_tokens_neox': 1321, 'n_words': 235}