<commit_before>import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { navigateToChallenge,} from '../actions';

const NavigateButton = ({routeSpec, label, onClick}) => {

  function handleClick() {
    onClick(routeSpec);
  }

  return (
    <div className="navigate-button" onClick={handleClick}>
      <div className="button-label navigate-button-label unselectable">
        {label}
      </div>
    </div>
  );
};

NavigateButton.propTypes = {
  label: PropTypes.string.isRequired,
  onClick: PropTypes.func.isRequired,
  routeSpec: PropTypes.object.isRequired
};

class Navigation extends Component {

  static backgroundClasses = 'navigation-layout'

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

    let missionNum = 1;

    const handleNavigateButton = function(routeSpec) {
      navigateToChallenge(routeSpec);
    };

    const navigateButton = function(level, mission, challenge) {
      return <NavigateButton label={"Mission " + missionNum++} 
                             routeSpec={{level: level - 1, mission: mission - 1, challenge: challenge - 1}} 
                             onClick={handleNavigateButton} />;
    };

    return (
      <div className="mission-backdrop navigation-layout">
        <div id="navigation">
          {navigateButton(1, 1, 1)}
          {navigateButton(2, 1, 1)}
          {navigateButton(2, 1, 2)}
          {navigateButton(2, 2, 1)}
          {navigateButton(2, 2, 2)}
          {navigateButton(2, 3, 1)}
          {navigateButton(2, 3, 2)}
          {navigateButton(2, 3, 3)}
          {navigateButton(2, 3, 4)}
          {navigateButton(2, 3, 5)}
          {navigateButton(6, 1, 1)}
          {navigateButton(6, 1, 2)}
        </div>
      </div>
    );
  }

  static propTypes = {
    navigateToChallenge: PropTypes.func.isRequired
  }

  static authoredDrakesToDrakeArray = function() {
    return [];
  }
}

function mapDispatchToProps(dispatch) {
  return {
    navigateToChallenge: (routeSpec) => dispatch(navigateToChallenge(routeSpec))
  };
}

const ConnectedNavigation = connect(() => {return {};}, mapDispatchToProps)(Navigation);
export default ConnectedNavigation;
<commit_msg>Removing unused conversion function<commit_after>import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { navigateToChallenge,} from '../actions';

const NavigateButton = ({routeSpec, label, onClick}) => {

  function handleClick() {
    onClick(routeSpec);
  }

  return (
    <div className="navigate-button" onClick={handleClick}>
      <div className="button-label navigate-button-label unselectable">
        {label}
      </div>
    </div>
  );
};

NavigateButton.propTypes = {
  label: PropTypes.string.isRequired,
  onClick: PropTypes.func.isRequired,
  routeSpec: PropTypes.object.isRequired
};

class Navigation extends Component {

  static backgroundClasses = 'navigation-layout'

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

    let missionNum = 1;

    const handleNavigateButton = function(routeSpec) {
      navigateToChallenge(routeSpec);
    };

    const navigateButton = function(level, mission, challenge) {
      return <NavigateButton label={"Mission " + missionNum++} 
                             routeSpec={{level: level - 1, mission: mission - 1, challenge: challenge - 1}} 
                             onClick={handleNavigateButton} />;
    };

    return (
      <div className="mission-backdrop navigation-layout">
        <div id="navigation">
          {navigateButton(1, 1, 1)}
          {navigateButton(2, 1, 1)}
          {navigateButton(2, 1, 2)}
          {navigateButton(2, 2, 1)}
          {navigateButton(2, 2, 2)}
          {navigateButton(2, 3, 1)}
          {navigateButton(2, 3, 2)}
          {navigateButton(2, 3, 3)}
          {navigateButton(2, 3, 4)}
          {navigateButton(2, 3, 5)}
          {navigateButton(6, 1, 1)}
          {navigateButton(6, 1, 2)}
        </div>
      </div>
    );
  }

  static propTypes = {
    navigateToChallenge: PropTypes.func.isRequired
  }
}

function mapDispatchToProps(dispatch) {
  return {
    navigateToChallenge: (routeSpec) => dispatch(navigateToChallenge(routeSpec))
  };
}

const ConnectedNavigation = connect(() => {return {};}, mapDispatchToProps)(Navigation);
export default ConnectedNavigation;

{'fraction_non_alphanumeric': 0.1312227575131911, 'fraction_numerical': 0.018352833218628125, 'mean_word_length': 2.8755555555555556, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 27, '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': '1863279', 'n_tokens_mistral': 1362, 'n_tokens_neox': 1290, 'n_words': 285}