<commit_before>import React from "react";
import { Modal } from "modal/modal";
import Link from "component/link/index";
import UserEmailNew from "component/userEmailNew";
import UserEmailVerify from "component/userEmailVerify";

class ModalEmailCollection extends React.PureComponent {
  renderInner() {
    const { closeModal, email, user } = this.props;

    const cancelButton = (
      <Link button="text" onClick={closeModal} label={__("Not Now")} />
    );

    if (!user.has_verified_email && !email) {
      return <UserEmailNew cancelButton={cancelButton} />;
    } else if (!user.has_verified_email) {
      return <UserEmailVerify cancelButton={cancelButton} />;
    } else {
      closeModal();
    }
  }

  render() {
    const { user } = this.props;

    //this shouldn't happen
    if (!user) {
      return null;
    }

    return (
      <Modal type="custom" isOpen={true} contentLabel="Email">
        <section>
          <h3 className="modal__header">
            Can We <strike>Touch You</strike> Stay In Touch?
          </h3>
          {this.renderInner()}
        </section>
      </Modal>
    );
  }
}

export default ModalEmailCollection;<commit_msg>don't touch you<commit_after>import React from "react";
import { Modal } from "modal/modal";
import Link from "component/link/index";
import UserEmailNew from "component/userEmailNew";
import UserEmailVerify from "component/userEmailVerify";

class ModalEmailCollection extends React.PureComponent {
  renderInner() {
    const { closeModal, email, user } = this.props;

    const cancelButton = (
      <Link button="text" onClick={closeModal} label={__("Not Now")} />
    );

    if (!user.has_verified_email && !email) {
      return <UserEmailNew cancelButton={cancelButton} />;
    } else if (!user.has_verified_email) {
      return <UserEmailVerify cancelButton={cancelButton} />;
    } else {
      closeModal();
    }
  }

  render() {
    const { user } = this.props;

    //this shouldn't happen
    if (!user) {
      return null;
    }

    return (
      <Modal type="custom" isOpen={true} contentLabel="Email">
        <section>
          <h3 className="modal__header">
            Can We Stay In Touch?
          </h3>
          {this.renderInner()}
        </section>
      </Modal>
    );
  }
}

export default ModalEmailCollection;
{'fraction_non_alphanumeric': 0.12989247311827956, 'fraction_numerical': 0.0017204301075268817, 'mean_word_length': 2.8637873754152823, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '7313688', 'n_tokens_mistral': 697, 'n_tokens_neox': 690, 'n_words': 167}