<commit_before>// @flow

import PropTypes from "prop-types";
import * as React from "react";
import classnames from "classnames";
import Transition from "react-transition-group/Transition";
import "./Modal.css";

type ModalProps = {
  status: string,
  children?: React.Node,
  additionalClass?: string,
  handleClose: () => any
};

export class Modal extends React.Component<ModalProps> {
  onClick = (e: SyntheticEvent<HTMLElement>) => {
    e.stopPropagation();
  };

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

    return (
      <div className="modal-wrapper" onClick={this.props.handleClose}>
        <div
          className={classnames("modal", this.props.additionalClass, status)}
          onClick={this.onClick}
        >
          {this.props.children}
        </div>
      </div>
    );
  }
}

Modal.contextTypes = {
  shortcuts: PropTypes.object
};

type SlideProps = {
  in: boolean,
  children?: React.Node,
  additionalClass?: string,
  handleClose: () => any
};

export default function Slide({
  in: inProp,
  children,
  additionalClass,
  handleClose
}: SlideProps) {
  return (
    <Transition in={inProp} timeout={175} appear>
      {status => (
        <Modal
          status={status}
          additionalClass={additionalClass}
          handleClose={handleClose}
        >
          {children}
        </Modal>
      )}
    </Transition>
  );
}
<commit_msg>Remove createClass and Proptypes warning (#4510)<commit_after>// @flow

import PropTypes from "prop-types";
import React from "react";
import type { Node as ReactNode } from "react";
import classnames from "classnames";
import Transition from "react-transition-group/Transition";
import "./Modal.css";

type ModalProps = {
  status: string,
  children?: ReactNode,
  additionalClass?: string,
  handleClose: () => any
};

export class Modal extends React.Component<ModalProps> {
  onClick = (e: SyntheticEvent<HTMLElement>) => {
    e.stopPropagation();
  };

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

    return (
      <div className="modal-wrapper" onClick={this.props.handleClose}>
        <div
          className={classnames("modal", this.props.additionalClass, status)}
          onClick={this.onClick}
        >
          {this.props.children}
        </div>
      </div>
    );
  }
}

Modal.contextTypes = {
  shortcuts: PropTypes.object
};

type SlideProps = {
  in: boolean,
  children?: ReactNode,
  additionalClass?: string,
  handleClose: () => any
};

export default function Slide({
  in: inProp,
  children,
  additionalClass,
  handleClose
}: SlideProps) {
  return (
    <Transition in={inProp} timeout={175} appear>
      {status => (
        <Modal
          status={status}
          additionalClass={additionalClass}
          handleClose={handleClose}
        >
          {children}
        </Modal>
      )}
    </Transition>
  );
}

{'fraction_non_alphanumeric': 0.13419761737911703, 'fraction_numerical': 0.00350385423966363, 'mean_word_length': 2.8117489986648865, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 31, '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': '6790859', 'n_tokens_mistral': 866, 'n_tokens_neox': 854, 'n_words': 195}