import React from 'react'; import { Link, withRouter } from "react-router-dom"; import { connect } from "react-redux"; import { showSidebar } from "../../actions/show-sidebar"; import { getLogoutUserSubmit } from "../../actions/logout"; import './sidebar.scss'; const siteMenu = [ { text: 'Home', href: '/', id: 0 }, { text: 'Events', href: '/events', id: 1 }, { text: 'Results', href: '/results', id: 2 }, { text: 'Gallery', href: '/gallery', id: 3 }, { text: 'Reviews', href: '/reviews', id: 4 } ]; export class Sidebar extends React.Component { logoutHandler = () => { localStorage.removeItem('user'); this.props.history.push('/'); this.props.getLogoutUserSubmit() } render() { const { showSidebar, showSidebarFlag } = this.props; const role = localStorage.user && JSON.parse(localStorage.user).user.role; return (