<commit_before>import React, { Component } from "react"
import Modal from "react-modal"

const timeElapsedLessThanFiveSec = insertedAt => {
  const millisecondsSinceRetroCreation = new Date(insertedAt)
  const timeElapsedSinceRetroCreation = new Date().getTime() - millisecondsSinceRetroCreation
  return (timeElapsedSinceRetroCreation < 5000)
}

class ShareRetroLinkModal extends Component {
  constructor(props) {
    super(props)
    this.closeModal = this.closeModal.bind(this)
    this.state = {
      closedByUser: false,
      shouldOpen: timeElapsedLessThanFiveSec(props.insertedAt)
    }
  }

  componentWillReceiveProps(nextProps) {
    const { insertedAt } = nextProps
    if (timeElapsedLessThanFiveSec(insertedAt)) {
      this.setState({ shouldOpen: true })
    }
  }

  closeModal() {
    this.setState({ closedByUser: true })
  }

  render() {
    const { closedByUser, shouldOpen } = this.state
    const hasntBeenClosed = !closedByUser

    return (
      <Modal
        contentLabel="Share Retro Link"
        isOpen={hasntBeenClosed && shouldOpen}
        className="ui small modal visible active"
        onRequestClose={this.closeModal}
      >
        <div className="ui basic padded segment">
          <button
            className="ui basic compact right floated icon button"
            onClick={this.closeModal}
          >
            <i className="close icon" />
          </button>
          <div className="ui center aligned header">
            <p>
              <i className="big icons">
                <i className="user icon" />
                <i className="corner announcement icon" />
              </i>
            </p>
            Share the unique retro link below with teammates!
          </div>
          <div className="ui fluid input">
            <input readOnly className="ui input" type="text" value={window.location} />
          </div>
        </div>
      </Modal>
    )
  }
}
<commit_msg>Add fade-in affect to share retro link modal<commit_after>import React, { Component } from "react"
import Modal from "react-modal"

const timeElapsedLessThanFiveSec = insertedAt => {
  const millisecondsSinceRetroCreation = new Date(insertedAt)
  const timeElapsedSinceRetroCreation = new Date().getTime() - millisecondsSinceRetroCreation
  return (timeElapsedSinceRetroCreation < 5000)
}

class ShareRetroLinkModal extends Component {
  constructor(props) {
    super(props)
    this.closeModal = this.closeModal.bind(this)
    this.state = {
      closedByUser: false,
      shouldOpen: timeElapsedLessThanFiveSec(props.insertedAt)
    }
  }

  componentWillReceiveProps(nextProps) {
    const { insertedAt } = nextProps
    if (timeElapsedLessThanFiveSec(insertedAt)) {
      this.setState({ shouldOpen: true })
    }
  }

  closeModal() {
    this.setState({ closedByUser: true })
  }

  render() {
    const { closedByUser, shouldOpen } = this.state
    const hasntBeenClosed = !closedByUser

    return (
      <Modal
        contentLabel="Share Retro Link"
        isOpen={hasntBeenClosed && shouldOpen}
        className="ui small modal visible transition fade in active"
        onRequestClose={this.closeModal}
      >
        <div className="ui basic padded segment">
          <button
            className="ui basic compact right floated icon button"
            onClick={this.closeModal}
          >
            <i className="close icon" />
          </button>
          <div className="ui center aligned header">
            <p>
              <i className="big icons">
                <i className="user icon" />
                <i className="corner announcement icon" />
              </i>
            </p>
            Share the unique retro link below with teammates!
          </div>
          <div className="ui fluid input">
            <input readOnly className="ui input" type="text" value={window.location} />
          </div>
        </div>
      </Modal>
    )
  }
}

{'fraction_non_alphanumeric': 0.09989832231825115, 'fraction_numerical': 0.0020335536349771225, 'mean_word_length': 2.4039792387543253, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, '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': '930350', 'n_tokens_mistral': 1105, 'n_tokens_neox': 1066, 'n_words': 268}