import React, { Component } from 'react' import PropTypes from 'prop-types' import { withStyles } from '@material-ui/core/styles' import AppBar from '@material-ui/core/AppBar' import Toolbar from '@material-ui/core/Toolbar' import Typography from '@material-ui/core/Typography' import IconButton from '@material-ui/core/IconButton' import Button from '@material-ui/core/Button' import classNames from 'classnames' // icons import HomeIcon from '@material-ui/icons/Home' import ExitIcon from '@material-ui/icons/ExitToApp' import { Link } from 'react-router-dom' import { getItem } from '../../utils/local-storage' // components import { LoggedIn } from './LoggedIn' import { LoggedOut } from './LoggedOut' import AALogo from '../../assets/advanced-algos/aa-logo-dark.svg' const ChartsLink = props => const UsersLink = props => const TeamsLink = props => const EventsLink = props => const KeyVaultLink = props => const HomeLink = props => const styles = theme => ({ '@global': { body: { backgroundColor: theme.palette.common.white } }, root: { flexGrow: 1 }, colorDefault: { color: '#000' }, flex: { flexGrow: 1 }, toolbarTitle: { flex: 1 }, menuButton: { marginLeft: -12, marginRight: 20 }, appBar: { position: 'relative' }, img: { display: 'block', maxWidth: 240, maxHeight: 48 }, externalLink: { textDecoration: 'none' } }) class Header extends Component { constructor (props) { super(props) this.state = { user: null, open: false } } async componentDidMount () { const user = window.localStorage.getItem('user') this.setState({ user }) } render () { let { classes, auth } = this.props let user = JSON.parse(this.state.user) return (