<commit_before>import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import Hammer from 'react-hammerjs';

class LayerContainerComponent extends PureComponent {
  handleSwipe() {
    const { layerActive, displayed, setDisplayed } = this.props;
    if (layerActive) {
      setDisplayed(!displayed);
    }
  }

  render() {
    const { displayed, children } = this.props;
    return (
      <Hammer
        onSwipe={() => this.handleSwipe()}
        direction="DIRECTION_VERTICAL"
      >
        <div className={`c-layer-container ${displayed ? '-displayed' : ''}`}>
          {children}
        </div>
      </Hammer>
    );
  }
}

LayerContainerComponent.propTypes = {
  displayed: PropTypes.bool,
  layerActive: PropTypes.object,
  children: PropTypes.node,
  setDisplayed: PropTypes.func
};

export default LayerContainerComponent;<commit_msg>use classnames instead of ternary expressions<commit_after>import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import Hammer from 'react-hammerjs';

class LayerContainerComponent extends PureComponent {
  handleSwipe() {
    const { layerActive, displayed, setDisplayed } = this.props;
    if (layerActive) {
      setDisplayed(!displayed);
    }
  }

  render() {
    const { displayed, children } = this.props;
    const classNames = classnames({
      'c-layer-container': true,
      '-displayed': displayed
    });

    return (
      <Hammer
        onSwipe={() => this.handleSwipe()}
        direction="DIRECTION_VERTICAL"
      >
        <div className={classNames}>
          {children}
        </div>
      </Hammer>
    );
  }
}

LayerContainerComponent.propTypes = {
  displayed: PropTypes.bool,
  layerActive: PropTypes.object,
  children: PropTypes.node,
  setDisplayed: PropTypes.func
};

export default LayerContainerComponent;
{'fraction_non_alphanumeric': 0.11936339522546419, 'fraction_numerical': 0.0, 'mean_word_length': 3.238202247191011, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '5924670', 'n_tokens_mistral': 556, 'n_tokens_neox': 551, 'n_words': 123}