import React from 'react' import PropTypes from 'prop-types' import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' import { me } from '../initial_state' import { CX } from '../constants' import Button from './button' class FooterBar extends React.PureComponent { static contextTypes = { router: PropTypes.object, } render() { const { notificationCount, homeItemsQueueCount, } = this.props const noRouter = !this.context.router const currentPathname = noRouter ? '' : this.context.router.route.location.pathname const buttons = [ { to: !me ? '/' : '/home', icon: 'home', title: 'Home', active: !me ? currentPathname === '/' : currentPathname === '/home', }, { to: '/notifications', icon: 'notifications', title: 'Notifications', isHidden: !me, active: currentPathname === '/notifications', }, { to: '/groups', icon: 'group', title: 'Groups', active: currentPathname === '/groups', }, { to: '/explore', icon: 'explore', title: 'Explore', isHidden: !me, active: currentPathname === '/explore', }, { to: '/news', icon: 'news', title: 'News', active: currentPathname === '/news', }, ] return (