<commit_before>import React, { Component } from 'react'
import {
  Navbar,
  Nav,
  NavItem,
  NavLink,
  Button,
  Container,
  Dropdown,
  DropdownToggle,
  DropdownItem,
} from 'reactstrap'

import NavbarBrand from '../NavbarBrand'

import { graphql } from 'react-apollo'
import gql from 'graphql-tag'

import avatarUrl from '../../utils/avatarUrl.js'
import style from './style.styl'
import radioEmoji from '../../assets/emojis/radio.png'

const currentUser = gql`
  query getMe {
    me {
      id
    }
  }
`

class ProfileButton extends Component {
  constructor (...props) {
    super(...props)
  }

  render() {

    const { me } = this.props

    return (
      <NavItem>
        {
          me ?
          <img className={style.profilePic} src={avatarUrl(me.id)} />
          :
          <NavLink href="/auth/facebook">
            <Button color="primary" size="sm">
              Login
            </Button>
          </NavLink>
        }
      </NavItem>
    )
  }
}

const Navigation = ({data, className}) => (
  <div className={className}>
    <Navbar className={style.nav} style={{borderRadius: 0}}>
      <Container>
        <NavbarBrand className={style.brand} to='/'>
          <img src={radioEmoji} />
          <span>RADIO ZIZI</span>
        </NavbarBrand>
        <Nav className="pull-xs-right" navbar>
          {
            data.loading ?
            <NavItem>Loading....</NavItem>
            :
            <ProfileButton me={data.me} />
          }
        </Nav>
      </Container>
    </Navbar>
  </div>
)

export default graphql(currentUser)(Navigation)<commit_msg>Improve Navbar<commit_after>import React, { Component } from 'react'
import {
  Navbar,
  Nav,
  NavItem,
  NavLink,
  Button,
  Container,
  Dropdown,
  DropdownToggle,
  DropdownItem,
} from 'reactstrap'

import { Link } from 'react-router'

import NavbarBrand from '../NavbarBrand'

import { graphql } from 'react-apollo'
import gql from 'graphql-tag'

import avatarUrl from '../../utils/avatarUrl.js'
import style from './style.styl'
import radioEmoji from '../../assets/emojis/radio.png'

const currentUser = gql`
  query getMe {
    me {
      id
    }
  }
`

class ProfileButton extends Component {
  constructor (...props) {
    super(...props)
  }

  render() {

    const { me } = this.props

    return (
      <NavItem>
        {
          me ?
          <Link to={`/u/${me.id}`}>
            <img className={style.profilePic} src={avatarUrl(me.id)} />
          </Link>
          :
          <NavLink href="/auth/facebook">
            <Button color="primary" size="sm">
              Login
            </Button>
          </NavLink>
        }
      </NavItem>
    )
  }
}

const Navigation = ({data, className}) => (
  <div className={className}>
    <Navbar className={style.nav} style={{borderRadius: 0}}>
      <Container>
        <NavbarBrand className={style.brand} to='/'>
          <img src={radioEmoji} />
          <span>RADIO ZIZI</span>
        </NavbarBrand>
        <Nav className="float-xs-right" navbar>
          {
            data.loading ?
            <NavItem>Loading....</NavItem>
            :
            <ProfileButton me={data.me} />
          }
        </Nav>
      </Container>
    </Navbar>
  </div>
)

export default graphql(currentUser)(Navigation)
{'fraction_non_alphanumeric': 0.14694250076057194, 'fraction_numerical': 0.000608457560085184, 'mean_word_length': 1.970189701897019, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 53, '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': '3815418', 'n_tokens_mistral': 1057, 'n_tokens_neox': 1042, 'n_words': 221}