<commit_before>import React, { PropTypes } from 'react';
import cx from 'classnames';
import attachClickHandler from '../utils/attachClickHandler';

const propTypes = {
  blades: PropTypes.object.isRequired,
  id: PropTypes.string.isRequired,
  index: PropTypes.number.isRequired,
  component: PropTypes.shape({
    type: PropTypes.func.isRequired,
    props: PropTypes.object,
  }).isRequired,
  width: PropTypes.number,
  isActive: PropTypes.bool,
  left: PropTypes.number.isRequired,
  hidden: PropTypes.bool,
  onActivate: PropTypes.func,
};

const defaultProps = {
  hidden: false,
  width: 300,
  onActivate() {},
};

const defaultZIndex = 1;

export default class BladeContainer extends React.Component {
  componentDidMount() {
    this.bladeClickListener = attachClickHandler(this.blade,
      (e) => this.props.onActivate(this.props.id, e)
    );
  }

  componentWillUnmount() {
    this.bladeClickListener.remove();
  }

  render() {
    const bladeStyle = {
      left: this.props.left,
      zIndex: defaultZIndex + this.props.index,
      width: this.props.width,<commit_msg>Scroll to blade when added to the container<commit_after>import React, { PropTypes } from 'react';
import cx from 'classnames';
import attachClickHandler from '../utils/attachClickHandler';

const propTypes = {
  blades: PropTypes.object.isRequired,
  id: PropTypes.string.isRequired,
  index: PropTypes.number.isRequired,
  component: PropTypes.shape({
    type: PropTypes.func.isRequired,
    props: PropTypes.object,
  }).isRequired,
  width: PropTypes.number,
  isActive: PropTypes.bool,
  left: PropTypes.number.isRequired,
  hidden: PropTypes.bool,
  onActivate: PropTypes.func,
};

const defaultProps = {
  hidden: false,
  width: 300,
  onActivate() {},
};

const defaultZIndex = 1;

export default class BladeContainer extends React.Component {
  componentDidMount() {
    this.bladeClickListener = attachClickHandler(this.blade,
      (e) => this.props.onActivate(this.props.id, e)
    );
    window.scrollTo(this.props.left, 0);
  }

  componentWillUnmount() {
    this.bladeClickListener.remove();
  }

  render() {
    const bladeStyle = {
      left: this.props.left,
      zIndex: defaultZIndex + this.props.index,
      width: this.props.width,
{'fraction_non_alphanumeric': 0.12049799911071588, 'fraction_numerical': 0.004001778568252557, 'mean_word_length': 3.9450549450549453, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5196137', 'n_tokens_mistral': 698, 'n_tokens_neox': 708, 'n_words': 152}