<commit_before>import React, { Component } from 'react';
import { connect } from 'react-redux';
import  { logout }  from '../actions/Auth';
import { browserHistory, Link } from 'react-router';

class UserNavContainer extends Component {

  onLogoutClick = () => {
    this.props.dispatch(logout())
    browserHistory.push("/login/")
  }

  matchRoute = (routeName) => {
    const {location} = this.props;
    console.log("this.props.location",location)
    console.log("indexOf",routeName, location.pathname.indexOf(routeName))
    return location.pathname.indexOf(routeName) >= 0 ? "active" : undefined
  }

  render() {
    const {user, location} = this.props;
    if(user) {
      return (
        <nav className="mb4">
          <ul className="nav nav-tabs">
            <li role="presentation" className={this.matchRoute("home")}>
              <Link className="gma-nav-font fw6 ttu gray" to="/home">Home</Link>
            </li>
            <li role="presentation" className={this.matchRoute("profile")}>
              <Link className="gma-nav-font fw6 ttu gray" to="/profile">My Profile</Link>
            </li>
            { user.kind === "Admin" &&
              <li role="presentation" className={this.matchRoute("admin")}>
                <Link className="gma-nav-font fw6 ttu gray" to="/admin/list">Admins</Link>
              </li>              
            }
            { (user.kind === "Admin" || user.kind === "Parent") &&
              <li role="presentation" className={this.matchRoute("gma")}>
                <Link className="gma-nav-font fw6 ttu gray" to="/gma/list">Gmas</Link>
              </li>
            }
            { user.kind === "Admin" &&
              <li role="presentation" className={this.matchRoute("parent")}>
                <Link className="gma-nav-font fw6 ttu gray" to="/parent/list">Parents</Link>
              </li>
            }     
            <button className="pull-right mt1 btn gma-orange-bg" onClick={() => this.onLogoutClick()}>Log out</button>
          </ul>
          
        </nav>
      )
    } else {
      return null;
    }
  }
}

const mapStateToProps = (state) => {
  const { auth } = state
  return {
    user: auth.user,
    loading: auth.loading
  }
}

export default connect(mapStateToProps)(UserNavContainer)<commit_msg>final user nav css update<commit_after>import React, { Component } from 'react';
import { connect } from 'react-redux';
import  { logout }  from '../actions/Auth';
import { browserHistory, Link } from 'react-router';

class UserNavContainer extends Component {

  onLogoutClick = () => {
    this.props.dispatch(logout())
    browserHistory.push("/login/")
  }

  matchRoute = (routeName) => {
    const {location} = this.props;
    console.log("this.props.location",location)
    console.log("indexOf",routeName, location.pathname.indexOf(routeName))
    return location.pathname.indexOf(routeName) >= 0 ? "active" : undefined
  }

  render() {
    const {user, location} = this.props;
    if(user) {
      return (
        <nav className="mb4">
          <ul className="nav nav-tabs">
            <li role="presentation" className={this.matchRoute("home")}>
              <Link className="gma-nav-font fw6 ttu gray tracked f4" to="/home">Home</Link>
            </li>
            <li role="presentation" className={this.matchRoute("profile")}>
              <Link className="gma-nav-font fw6 ttu gray tracked f4" to="/profile">My Profile</Link>
            </li>
            { user.kind === "Admin" &&
              <li role="presentation" className={this.matchRoute("admin")}>
                <Link className="gma-nav-font fw6 ttu gray tracked f4" to="/admin/list">Admins</Link>
              </li>              
            }
            { (user.kind === "Admin" || user.kind === "Parent") &&
              <li role="presentation" className={this.matchRoute("gma")}>
                <Link className="gma-nav-font fw6 ttu gray tracked f4" to="/gma/list">Gmas</Link>
              </li>
            }
            { user.kind === "Admin" &&
              <li role="presentation" className={this.matchRoute("parent")}>
                <Link className="gma-nav-font fw6 ttu gray tracked f4" to="/parent/list">Parents</Link>
              </li>
            }     
            <button className="pull-right mt1 btn gma-orange-bg" onClick={() => this.onLogoutClick()}>Log out</button>
          </ul>
          
        </nav>
      )
    } else {
      return null;
    }
  }
}

const mapStateToProps = (state) => {
  const { auth } = state
  return {
    user: auth.user,
    loading: auth.loading
  }
}

export default connect(mapStateToProps)(UserNavContainer)
{'fraction_non_alphanumeric': 0.15688802922845477, 'fraction_numerical': 0.004513217279174726, 'mean_word_length': 2.247732030704815, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 65, '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': '7548421', 'n_tokens_mistral': 1401, 'n_tokens_neox': 1370, 'n_words': 285}