<commit_before>import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Radium from 'radium';
import pure from 'recompose/pure';
import Measure from 'react-measure';
import styles from './styles';
import getStyles from './get-styles';
import Button from '../button';
import IconClose from '../icons/icon-close';
import colors from '../settings/colors';

/** 728x90 and 320x50 banners */
class Banner extends Component {
  static displayName = 'Banner'

  static propTypes = {
    /** Content of the Banner */
    content: PropTypes.shape({
      /** 728x90 banner */
      desktop: PropTypes.node.isRequired,
      /** 320x50 banner */
      mobile: PropTypes.node.isRequired
    }).isRequired,
    hideBanner: PropTypes.func.isRequired,
    /** Override the styles of the root element */
    style: PropTypes.instanceOf(Object),
    /** Toggle banner open */
    open: PropTypes.bool
  }

  static defaultProps = {
    style: {},
    open: false
  }

  constructor() {
    super();

    this.state = {
      type: 'desktop'
    };

    this.handleMeasure = this.handleMeasure.bind(this);
  }

  handleMeasure(dimensions) {
    const { type } = this.state;

    if (dimensions.width < 728 && type === 'desktop') {
      this.setState({
        type: 'mobile'
      });
    }

    if (dimensions.width > 728 && type === 'mobile') {
      this.setState({
        type: 'desktop'
      });
    }
  }

  render() {
    const { style, content, hideBanner, open } = this.props;
    const { type } = this.state;

    if (!open) {
      return null;
    }

    return (
      <Measure onMeasure={this.handleMeasure}>
        <section style={styles.wrapper}>
          <section style={getStyles.root(style)}>
            {content[type]}
            <Button iconButton onClick={hideBanner} style={styles.button}>
              <IconClose color={colors.white} />
            </Button>
          </section>
        </section>
      </Measure>
    );
  }
}

export default pure(Radium(Banner));
<commit_msg>:ambulance: Added missing type (#613)<commit_after>import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Radium from 'radium';
import pure from 'recompose/pure';
import Measure from 'react-measure';
import styles from './styles';
import getStyles from './get-styles';
import Button from '../button';
import IconClose from '../icons/icon-close';
import colors from '../settings/colors';

/** 728x90 and 320x50 banners */
class Banner extends Component {
  static displayName = 'Banner'

  static propTypes = {
    /** Content of the Banner */
    content: PropTypes.shape({
      /** 728x90 banner */
      desktop: PropTypes.node.isRequired,
      /** 320x50 banner */
      mobile: PropTypes.node.isRequired
    }).isRequired,
    hideBanner: PropTypes.func.isRequired,
    /** Override the styles of the root element */
    style: PropTypes.instanceOf(Object),
    /** Toggle banner open */
    open: PropTypes.bool
  }

  static defaultProps = {
    style: {},
    open: false
  }

  constructor() {
    super();

    this.state = {
      type: 'desktop'
    };

    this.handleMeasure = this.handleMeasure.bind(this);
  }

  handleMeasure(dimensions) {
    const { type } = this.state;

    if (dimensions.width < 728 && type === 'desktop') {
      this.setState({
        type: 'mobile'
      });
    }

    if (dimensions.width > 728 && type === 'mobile') {
      this.setState({
        type: 'desktop'
      });
    }
  }

  render() {
    const { style, content, hideBanner, open } = this.props;
    const { type } = this.state;

    if (!open) {
      return null;
    }

    return (
      <Measure onMeasure={this.handleMeasure}>
        <section style={styles.wrapper}>
          <section style={getStyles.root(type, style)}>
            {content[type]}
            <Button iconButton onClick={hideBanner} style={styles.button}>
              <IconClose color={colors.white} />
            </Button>
          </section>
        </section>
      </Measure>
    );
  }
}

export default pure(Radium(Banner));

{'fraction_non_alphanumeric': 0.14187530682376043, 'fraction_numerical': 0.013500245459008346, 'mean_word_length': 2.471039182282794, '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': '6160402', 'n_tokens_mistral': 1258, 'n_tokens_neox': 1199, 'n_words': 309}