Logged In User Icon working

This commit is contained in:
Luis Fernando Molina committed 2018-10-14 09:35:30 +02:00
1 parent 208d4f393d
commit 853351f63a
3 files changed
+16 -12

No files matched your search

+14 -1
View File
@@ -4,6 +4,13 @@ import {getUserByAuthIdQuery} from '../queries/queries'
import LoggedInUserMenu from './LoggedInUserMenu'
import Button from '@material-ui/core/Button'
import IconButton from '@material-ui/core/IconButton'
// icons
import UserIcon from '@material-ui/icons/Person'
import { Link } from 'react-router-dom'
const UserLink = props => <Link to='/user' {...props} />
class LoggedInUser extends Component {
@@ -35,7 +42,13 @@ class LoggedInUser extends Component {
return (
<div>
<p><LoggedInUserMenu menuLabel={displayName} identityProvider={identityProvider} /></p>
<IconButton
color='inherit'
title='Your Profile'
component={UserLink}>
<UserIcon />
</IconButton>
</div>
)
} else {
-9
View File
@@ -12,14 +12,12 @@ 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 UserIcon from '@material-ui/icons/Person'
import { Link } from 'react-router-dom'
// components
import LoggedInUser from './LoggedInUser'
const UserLink = props => <Link to='/user' {...props} />
const AboutLink = props => <Link to='/about' {...props} />
const ContactLink = props => <Link to='/contact' {...props} />
const SearchLink = props => <Link to='/search' {...props} />
@@ -113,13 +111,6 @@ class NavBar extends Component {
component={AboutLink}>
<AboutIcon />
</IconButton>
<IconButton
className={classes.menuButton}
color='inherit'
title='Your Profile'
component={UserLink}>
<UserIcon />
</IconButton>
<LoggedInUser authId={this.state.authId} />
</Toolbar>
</AppBar>
+2 -2
View File
@@ -279,8 +279,8 @@ class ProfileSheet extends Component {
displayIdentityProvider () {
const { classes } = this.props
let authId = this.state.authId
console.log('state', this.state)
if (authId !== undefined) {
if (authId !== undefined && authId !== null) {
let authArray = this.state.authId.split('|')
let identityProvider = authArray[0]