<commit_before>'use babel';

import React, { Component, PropTypes } from 'react';
import styles from './navbar.css';

export default class NavBar extends Component {

  handleClick(view) {
    this.props.switchView(view);
  }

  checkIsActive(currentElement) {
    console.log(currentElement);
    return (currentElement.toLowerCase() === this.props.windowToRender.toLowerCase()) ? styles.navActive : '';
  }

  render() {
    const navToRender = [{
      name: 'announcements',
      icon: 'announcement'
    }, {
      name: 'multimedia',
      icon: 'video_library'
    }, {
      name: 'forum',
      icon: 'forum'
    }];
    const self = this;
    return (
      <div className={styles.navBar}>
        <ul>
          {navToRender.map((navElement) =>
            <li key={navElement.name}>
              <button
                className={`${styles.navButton} ${this.checkIsActive(navElement.name)}`}
                onClick={function onClick() {
                  self.handleClick(navElement.name);
                }}
              >
                <i className="material-icons">
                  {navElement.icon}
                </i>
              </button>
            </li>
          )}
        </ul>
      </div>
    );
  }
}

NavBar.propTypes = {
  windowToRender: PropTypes.string.isRequired,
};<commit_msg>Add function prop type<commit_after>'use babel';

import React, { Component, PropTypes } from 'react';
import styles from './navbar.css';

export default class NavBar extends Component {

  handleClick(view) {
    this.props.switchView(view);
  }

  checkIsActive(currentElement) {
    console.log(currentElement);
    return (currentElement.toLowerCase() === this.props.windowToRender.toLowerCase()) ? styles.navActive : '';
  }

  render() {
    const navToRender = [{
      name: 'announcements',
      icon: 'announcement'
    }, {
      name: 'multimedia',
      icon: 'video_library'
    }, {
      name: 'forum',
      icon: 'forum'
    }];
    const self = this;
    return (
      <div className={styles.navBar}>
        <ul>
          {navToRender.map((navElement) =>
            <li key={navElement.name}>
              <button
                className={`${styles.navButton} ${this.checkIsActive(navElement.name)}`}
                onClick={function onClick() {
                  self.handleClick(navElement.name);
                }}
              >
                <i className="material-icons">
                  {navElement.icon}
                </i>
              </button>
            </li>
          )}
        </ul>
      </div>
    );
  }
}

NavBar.propTypes = {
  windowToRender: PropTypes.string.isRequired,
  switchView: PropTypes.func.isRequired
};
{'fraction_non_alphanumeric': 0.13840445269016696, 'fraction_numerical': 0.0, 'mean_word_length': 1.9368191721132897, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 25, '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': '1655405', 'n_tokens_mistral': 791, 'n_tokens_neox': 775, 'n_words': 141}