import React, { Component } from 'react' import PropTypes from 'prop-types' import { withStyles } from '@material-ui/core/styles' import classNames from 'classnames' import AppBar from '@material-ui/core/AppBar' import Toolbar from '@material-ui/core/Toolbar' import Typography from '@material-ui/core/Typography' import Button from '@material-ui/core/Button' // icons import UsersIcon from '@material-ui/icons/People' import BrowseIcon from '@material-ui/icons/ImportContacts' import SearchIcon from '@material-ui/icons/Search' import ContactIcon from '@material-ui/icons/ContactMail' import AboutIcon from '@material-ui/icons/FormatShapes' import { Link } from 'react-router-dom' // components import LoggedInUser from './LoggedInUser' const HomeLink = props => const BrowseLink = props => const SearchLink = props => const AboutLink = props => const styles = theme => ({ root: { flexGrow: 1 }, flex: { flexGrow: 1, marginLeft: 30 }, menuButton: { marginLeft: -12, marginRight: 20 }, cssRoot: { color: '#FFFFFF', backgroundColor: theme.palette.secondary, '&:hover': { backgroundColor: theme.palette.dark }, whiteSpace: 'nowrap', paddingRight: 2 * theme.spacing.unit, paddingLeft: 2 * theme.spacing.unit }, button: { margin: theme.spacing.unit }, leftIcon: { marginRight: theme.spacing.unit }, rightIcon: { marginLeft: theme.spacing.unit }, iconSmall: { fontSize: 20 } }) class NavBar extends Component { constructor (props) { super(props) this.state = { authId: null } } componentDidMount () { let user = localStorage.getItem('user') let authId if (user !== null && user !== undefined && user !== 'undefined') { user = JSON.parse(user) authId = user.authId } if (authId !== null && authId !== undefined && authId !== 'undefined') { this.setState({ authId: authId }) } } render () { const { classes, user, match } = this.props console.log('NavBar: ', user, match) return (
Users Module
) } } NavBar.propTypes = { classes: PropTypes.object.isRequired, user: PropTypes.object, match: PropTypes.object } export default withStyles(styles)(NavBar)