<commit_before>import React, { Component } from 'react'
import { Link } from 'react-router'

import './Navbar.css'


class Navbar extends Component {

  constructor() {
    super()
    this.state = ({
      hamburgerOpen: false,
      mobileLinkState: '',
      hamburgerIcon: 'ion-navicon-round'
    })

    this.toggleDropdown = this.toggleDropdown.bind(this)
    this.handleMobileClick = this.handleMobileClick.bind(this)
  }


  toggleDropdown() {
    const hamburgerOpen = !this.state.hamburgerOpen
    const [ hamburgerIcon, mobileLinkState ] = hamburgerOpen
      ? ['ion-close-round close-icon', 'mobile-nav-open']
      : ['ion-navicon-round', '']
    this.setState({ hamburgerOpen, mobileLinkState, hamburgerIcon })
  }


  handleMobileClick() {
    if (this.state.hamburgerOpen) this.toggleDropdown()
  }


  render() {
    const { hamburgerIcon, mobileLinkState } = this.state
    const { handleMobileClick, toggleDropdown } = this

    return (
      <nav className="nav-container">
        <Link to="/home" onClick={handleMobileClick}>
          <img
            className="logo-nav"<commit_msg>stop scroll during mobile nav<commit_after>import React, { Component } from 'react'
import { Link } from 'react-router'

import './Navbar.css'


class Navbar extends Component {

  constructor() {
    super()
    this.state = ({
      hamburgerOpen: false,
      mobileLinkState: '',
      hamburgerIcon: 'ion-navicon-round'
    })

    this.toggleDropdown = this.toggleDropdown.bind(this)
    this.handleMobileClick = this.handleMobileClick.bind(this)
  }


  toggleDropdown() {
    const hamburgerOpen = !this.state.hamburgerOpen

    const [ hamburgerIcon, mobileLinkState ] = hamburgerOpen
      ? ['ion-close-round close-icon', 'mobile-nav-open']
      : ['ion-navicon-round', '']

    document.body.style.overflow = hamburgerOpen ? 'hidden' : ''
    this.setState({ hamburgerOpen, mobileLinkState, hamburgerIcon })
  }


  handleMobileClick() {
    if (this.state.hamburgerOpen) this.toggleDropdown()
  }


  render() {
    const { hamburgerIcon, mobileLinkState } = this.state
    const { handleMobileClick, toggleDropdown } = this

    return (
      <nav className="nav-container">
        <Link to="/home" onClick={handleMobileClick}>
          <img
            className="logo-nav"
{'fraction_non_alphanumeric': 0.12603215993046502, 'fraction_numerical': 0.0, 'mean_word_length': 3.162748643761302, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '3287406', 'n_tokens_mistral': 744, 'n_tokens_neox': 702, 'n_words': 134}