<commit_before>import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { Navbar, Nav, NavItem } from 'react-bootstrap';
import { LinkContainer } from 'react-router-bootstrap';
import PubSub from 'pubsub-js';
import CONSTANTS from './constants';

class NavMenu extends React.Component {
  constructor(props) {
    super(props);
  }

  logout() {
    // TODO: add api call to expire cookie
    PubSub.publish(CONSTANTS.PUB_SUB.LOGOUT);
  }

  render()
  {
    if(this.props.isLoggedIn) {
      return (
        <Navbar collapseOnSelect fluid staticTop bsClass="cc-nav-menu navbar">
          <Navbar.Header>
            <Navbar.Toggle />
          </Navbar.Header>
          <Navbar.Collapse>
            <Nav justified>
              <LinkContainer to="/shop" activeClassName="active">
                <NavItem eventKey={CONSTANTS.NAV_BAR.KEYS.SHOP}>Shop</NavItem>
              </LinkContainer>
              <LinkContainer to="/deals" activeClassName="active">
                <NavItem eventKey={CONSTANTS.NAV_BAR.KEYS.DEALS}>Deals</NavItem>
              </LinkContainer>
              <LinkContainer to="/credit-cards" activeClassName="active"><commit_msg>Add api call for logout<commit_after>import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { Navbar, Nav, NavItem } from 'react-bootstrap';
import { LinkContainer } from 'react-router-bootstrap';
import PubSub from 'pubsub-js';
import CONSTANTS from './constants';
import apiClient from '../api/apiClient';

class NavMenu extends React.Component {
  constructor(props) {
    super(props);
  }

  logout() {
    apiClient.callCreditCardsApi(CONSTANTS.HTTP_METHODS.POST, '/logout', (response) => { });
    PubSub.publish(CONSTANTS.PUB_SUB.LOGOUT);
  }

  render()
  {
    if(this.props.isLoggedIn) {
      return (
        <Navbar collapseOnSelect fluid staticTop bsClass="cc-nav-menu navbar">
          <Navbar.Header>
            <Navbar.Toggle />
          </Navbar.Header>
          <Navbar.Collapse>
            <Nav justified>
              <LinkContainer to="/shop" activeClassName="active">
                <NavItem eventKey={CONSTANTS.NAV_BAR.KEYS.SHOP}>Shop</NavItem>
              </LinkContainer>
              <LinkContainer to="/deals" activeClassName="active">
                <NavItem eventKey={CONSTANTS.NAV_BAR.KEYS.DEALS}>Deals</NavItem>
              </LinkContainer>
              <LinkContainer to="/credit-cards" activeClassName="active">
{'fraction_non_alphanumeric': 0.12707838479809977, 'fraction_numerical': 0.0, 'mean_word_length': 2.7660208643815203, 'pattern_counts': {'":': 0, '<': 33, '<?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': '7019919', 'n_tokens_mistral': 761, 'n_tokens_neox': 744, 'n_words': 153}