<commit_before>import React from 'react'
import NavMenu from 'redux/containers/NavMenuContainer'
import { desktopNavMenuWidth, tabletBreakpoint } from 'constants/design'
import '../../styles/core.scss'

class CoreLayout extends React.Component {

  constructor () {
    super()
    this.handleResize = this.handleResize.bind(this)
    this.state = {width: window.innerWidth}
  }

  static propTypes = {
    children: React.PropTypes.element.isRequired
  }

  componentDidMount () {
    window.addEventListener('resize', this.handleResize)
  }

  componentWillUnmount () {
    window.removeEventListener('resize', this.handleResize)
  }

  handleResize () {
    this.setState({width: window.innerWidth})
  }

  navMenuDisplay () {
    return window.location.href.includes('/login') ? 'none' : 'block'
  }

  mainContainerPadding () {
    return window.location.href.includes('/login') || this.state.width <= tabletBreakpoint
      ? '0px' : `${desktopNavMenuWidth}%`
  }

  render () {
    return (
      <div>
        <div style={{'display': this.navMenuDisplay()}} >
          <NavMenu />
        </div>
        <div style={{'paddingLeft': this.mainContainerPadding()}}>
          {this.props.children}
        </div><commit_msg>Fix nav menu appear (#30)<commit_after>import React from 'react'
import NavMenu from 'redux/containers/NavMenuContainer'
import { desktopNavMenuWidth, tabletBreakpoint } from 'constants/design'
import '../../styles/core.scss'

class CoreLayout extends React.Component {

  constructor () {
    super()
    this.handleResize = this.handleResize.bind(this)
    this.state = {width: window.innerWidth}
  }

  static propTypes = {
    children: React.PropTypes.element.isRequired
  }

  componentDidMount () {
    window.addEventListener('resize', this.handleResize)
  }

  componentWillUnmount () {
    window.removeEventListener('resize', this.handleResize)
  }

  handleResize () {
    this.setState({width: window.innerWidth})
  }

  hasLoggedIn () {
    return window.location.href.includes('/dashboard') || window.location.href.includes('/application')
  }

  navMenuDisplay () {
    return this.hasLoggedIn() ? 'block' : 'none'
  }

  mainContainerPadding () {
    return !this.hasLoggedIn() || this.state.width <= tabletBreakpoint ? '0px' : `${desktopNavMenuWidth}%`
  }

  render () {
    return (
      <div>
        <div style={{'display': this.navMenuDisplay()}} >
          <NavMenu />
        </div>
        <div style={{'paddingLeft': this.mainContainerPadding()}}>
          {this.props.children}
        </div>
{'fraction_non_alphanumeric': 0.14414414414414414, 'fraction_numerical': 0.0015667841754798276, 'mean_word_length': 3.328813559322034, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 15, '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': '7133333', 'n_tokens_mistral': 769, 'n_tokens_neox': 767, 'n_words': 135}