<commit_before>import React from 'react';
import InputWrap from './input_wrap';
import Icon from '../icon/icon';
import { requestGravatar } from '../gravatar/actions';

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

  render() {
    const { isValid, onChange, gravatar, ...props } = this.props;
    const { focused } = this.state;

    return (
      <InputWrap name="email" isValid={isValid} icon={<Icon name="email" />} focused={focused}>
        <input type="text"
          name="email"
          className="auth0-lock-input"
          placeholder="<EMAIL>"
          onChange={::this.handleOnChange}
          {...props}/>
      </InputWrap>
    );
  }

  handleOnChange(e) {
    if (this.props.gravatar) {
      requestGravatar(e.target.value);
    }

    if (this.props.onChange) {
      this.props.onChange(e);
    }
  }

  handleFocus() {
    this.setState({focused: true});
  }

  handleBlur() {
    this.setState({focused: false});
  }
}

// TODO: specify propTypes
<commit_msg>Forgot to add focus/blur handlers in EmailInput<commit_after>import React from 'react';
import InputWrap from './input_wrap';
import Icon from '../icon/icon';
import { requestGravatar } from '../gravatar/actions';

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

  render() {
    const { isValid, onChange, gravatar, ...props } = this.props;
    const { focused } = this.state;

    return (
      <InputWrap name="email" isValid={isValid} icon={<Icon name="email" />} focused={focused}>
        <input type="text"
          name="email"
          className="auth0-lock-input"
          placeholder="<EMAIL>"
          onChange={::this.handleOnChange}
          onFocus={::this.handleFocus}
          onBlur={::this.handleBlur}
          {...props}/>
      </InputWrap>
    );
  }

  handleOnChange(e) {
    if (this.props.gravatar) {
      requestGravatar(e.target.value);
    }

    if (this.props.onChange) {
      this.props.onChange(e);
    }
  }

  handleFocus() {
    this.setState({focused: true});
  }

  handleBlur() {
    this.setState({focused: false});
  }
}

// TODO: specify propTypes

{'fraction_non_alphanumeric': 0.15641711229946523, 'fraction_numerical': 0.00089126559714795, 'mean_word_length': 2.6444805194805197, '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': '2817054', 'n_tokens_mistral': 716, 'n_tokens_neox': 700, 'n_words': 140}