<commit_before>import React, { Component, PropTypes } from 'react';
import Modal from 'react-modal';

require('../../styles/DashboardModal.scss');

export default class InviteUser extends Component {
  constructor(props) {
    super(props);
    this.state = { email: '' };
    this.onChange = this.onChange.bind(this);
    this.handleInvite = this.handleInvite.bind(this);
  }

  onChange(event) {
    const email = event.target.value.trim().toLowerCase();
    this.setState({ email });
  }

  handleInvite() {
    this.props.onInviteUser(this.state.email);
    this.setState({ email: '' });
  }

  render() {
    const { isOpen, onClose } = this.props;
    return (
      <Modal
        isOpen={isOpen}
        contentLabel="userInviteModal"
        style={{
          content: {
            width: 500,
            height: 300,
            marginLeft: 'auto',
            marginRight: 'auto',
            borderRadius: 0,
            border: '0.1rem solid rgb(223, 244, 234)',
          },
          overlay: {
            zIndex: 1000,
            backgroundColor: 'rgba(0,0,0,0.6)',
          },
        }}
      >
        <div className="DashboardModal">
          <div className="InviteUserModal">
            <h2 className="modalTitle">Invite User</h2>
            <div
              className="close clickable"
              onClick={onClose}
            >
            +
            </div>
            <div className="contents">
              <p>Please enter the email address you would like to invite below.</p>
              <input
                name="email"
                onChange={this.onChange}
                placeholder="e.g. <EMAIL>"
                type="email"
                value={this.state.emailAddress}
              />
              <button onClick={this.handleInvite}>Send</button>
            </div>
          </div>
        </div>
      </Modal>
    );
  }
}

InviteUser.propTypes = {
  handleInvite: PropTypes.func.isRequired,
  invitedUserEmail: PropTypes.string.isRequired,
  isOpen: PropTypes.bool.isRequired,
  onChange: PropTypes.func.isRequired,
  onClose: PropTypes.func.isRequired,
  onInviteUser: PropTypes.func.isRequired,
};<commit_msg>[#455] WIP: Fixed PropTypes warnings in Users/InviteUsers components<commit_after>import React, { Component, PropTypes } from 'react';
import Modal from 'react-modal';

require('../../styles/DashboardModal.scss');

export default class InviteUser extends Component {
  constructor(props) {
    super(props);
    this.state = { email: '' };
    this.onChange = this.onChange.bind(this);
    this.handleInvite = this.handleInvite.bind(this);
  }

  onChange(event) {
    const email = event.target.value.trim().toLowerCase();
    this.setState({ email });
  }

  handleInvite() {
    this.props.onInviteUser(this.state.email);
    this.setState({ email: '' });
  }

  render() {
    const { isOpen, onClose } = this.props;
    return (
      <Modal
        isOpen={isOpen}
        contentLabel="userInviteModal"
        style={{
          content: {
            width: 500,
            height: 300,
            marginLeft: 'auto',
            marginRight: 'auto',
            borderRadius: 0,
            border: '0.1rem solid rgb(223, 244, 234)',
          },
          overlay: {
            zIndex: 1000,
            backgroundColor: 'rgba(0,0,0,0.6)',
          },
        }}
      >
        <div className="DashboardModal">
          <div className="InviteUserModal">
            <h2 className="modalTitle">Invite User</h2>
            <div
              className="close clickable"
              onClick={onClose}
            >
            +
            </div>
            <div className="contents">
              <p>Please enter the email address you would like to invite below.</p>
              <input
                name="email"
                onChange={this.onChange}
                placeholder="e.g. <EMAIL>"
                type="email"
                value={this.state.emailAddress}
              />
              <button onClick={this.handleInvite}>Send</button>
            </div>
          </div>
        </div>
      </Modal>
    );
  }
}

InviteUser.propTypes = {
  isOpen: PropTypes.bool.isRequired,
  onClose: PropTypes.func.isRequired,
  onInviteUser: PropTypes.func.isRequired,
};
{'fraction_non_alphanumeric': 0.13042463835744283, 'fraction_numerical': 0.014232384507699487, 'mean_word_length': 1.8297029702970298, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, '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': '4497704', 'n_tokens_mistral': 1269, 'n_tokens_neox': 1240, 'n_words': 237}