<commit_before>import { Component, PropTypes } from "react"
import ReactDom from "react-dom"
import { routeActions } from "../../store/routing"

import Styles from "./nav.css"

export default class NavLink extends Component {

  static propTypes = {
    navItem: PropTypes.object.isRequired
  }


  linkClasses = () => {

    const { navItem } = this.props

    let classes = [
      "floating__item",
      "soft-sides@handheld",
      "soft-half-ends@lap-and-up",
      "one-whole@lap-and-up",
      "plain"
    ];

    if (this.props.fgColor === "light") {
      classes.push("text-light-primary");
    } else {
      classes.push("text-dark-primary");
    }

    if (navItem.isActive && navItem.isActive(this.props)) {
      classes.push("text-brand")
    }


    return classes.join(" ")
  }

  handleAction = (e) => {
    e.preventDefault();
    const { navItem } = this.props

    this.props.reset()

    if (navItem.action && typeof navItem.action === "function") {

      this.props.handleAction(navItem.action)
      return
    }

    if (navItem.link && (navItem.link != window.location.pathname)) {
      function navigate() {
        return routeActions.push(navItem.link)
      }
      this.props.handleAction(navigate)
    }
  }

  render () {
    const iconClasses = `${this.props.navItem.icon} display-block`;
    let { navItem } = this.props

    let itemStyle = {}
    if (Meteor.isCordova) {
      itemStyle = {
        marginTop: "-3px"
      }
    }
    return (
      <button
        className={this.linkClasses()}
        onClick={this.handleAction}
        style={{minHeight: "60px"}}
      >
        <div className={`floating ${Styles["locked"]} soft-half-top@handheld`} >
          <div className="floating__item">
            <i className={iconClasses} style={itemStyle}></i>
            {() => {
              if (navItem.label) {
                return (
                  <h7 className="display-block">
                    <small className="text-center">{navItem.label}</small>
                  </h7>
                )
              }
            }()}

          </div>

        </div>
      </button>
    )
  }
}<commit_msg>adjust nav items when there's no label<commit_after>import { Component, PropTypes } from "react"
import ReactDom from "react-dom"
import { routeActions } from "../../store/routing"

import Styles from "./nav.css"

export default class NavLink extends Component {

  static propTypes = {
    navItem: PropTypes.object.isRequired
  }


  linkClasses = () => {

    const { navItem } = this.props

    let classes = [
      "floating__item",
      "soft-sides@handheld",
      "soft-half-ends@lap-and-up",
      "one-whole@lap-and-up",
      "plain"
    ];

    if (this.props.fgColor === "light") {
      classes.push("text-light-primary");
    } else {
      classes.push("text-dark-primary");
    }

    if (navItem.isActive && navItem.isActive(this.props)) {
      classes.push("text-brand")
    }


    return classes.join(" ")
  }

  containerClasses = () => {

    const { navItem } = this.props;

    let classes = [
      "floating",
      Styles["locked"],
    ];

    if (navItem.label) {
      classes.push("soft-half-top@handheld");
    }

    return classes.join(" ");
  }

  handleAction = (e) => {
    e.preventDefault();
    const { navItem } = this.props

    this.props.reset()

    if (navItem.action && typeof navItem.action === "function") {

      this.props.handleAction(navItem.action)
      return
    }

    if (navItem.link && (navItem.link != window.location.pathname)) {
      function navigate() {
        return routeActions.push(navItem.link)
      }
      this.props.handleAction(navigate)
    }
  }

  render () {
    const iconClasses = `${this.props.navItem.icon} display-block`;
    let { navItem } = this.props

    let itemStyle = {}
    if (Meteor.isCordova) {
      itemStyle = {
        marginTop: "-3px"
      }
    }
    return (
      <button
        className={this.linkClasses()}
        onClick={this.handleAction}
        style={{minHeight: "60px"}}
      >
        <div className={this.containerClasses()}>
          <div className="floating__item">
            <i className={iconClasses} style={itemStyle}></i>
            {() => {
              if (navItem.label) {
                return (
                  <h7 className="display-block">
                    <small className="text-center">{navItem.label}</small>
                  </h7>
                )
              }
            }()}

          </div>

        </div>
      </button>
    )
  }
}
{'fraction_non_alphanumeric': 0.15050460728389645, 'fraction_numerical': 0.002193944712593243, 'mean_word_length': 1.9584685269305646, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 34, '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': '7464364', 'n_tokens_mistral': 1443, 'n_tokens_neox': 1398, 'n_words': 245}