Logged In section only accesible when logged in
This commit is contained in:
1 parent
853351f63a
commit
60ede64c19
2 files changed
+3
-12
No files matched your search
@@ -2,7 +2,6 @@ import React, { Component } from 'react'
|
|||||||
import {graphql} from 'react-apollo'
|
import {graphql} from 'react-apollo'
|
||||||
import {getUserByAuthIdQuery} from '../queries/queries'
|
import {getUserByAuthIdQuery} from '../queries/queries'
|
||||||
|
|
||||||
import LoggedInUserMenu from './LoggedInUserMenu'
|
|
||||||
import Button from '@material-ui/core/Button'
|
import Button from '@material-ui/core/Button'
|
||||||
import IconButton from '@material-ui/core/IconButton'
|
import IconButton from '@material-ui/core/IconButton'
|
||||||
|
|
||||||
@@ -53,9 +52,7 @@ class LoggedInUser extends Component {
|
|||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div />
|
||||||
<Button color='inherit'>Login / Sign up</Button>
|
|
||||||
</div>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -65,7 +62,6 @@ class LoggedInUser extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
console.log('props', this.props)
|
|
||||||
if (this.loggedInUserStored !== true) {
|
if (this.loggedInUserStored !== true) {
|
||||||
let user = this.props.data.users_UserByAuthId
|
let user = this.props.data.users_UserByAuthId
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import Typography from '@material-ui/core/Typography'
|
|||||||
import IconButton from '@material-ui/core/IconButton'
|
import IconButton from '@material-ui/core/IconButton'
|
||||||
|
|
||||||
// icons
|
// icons
|
||||||
import HomeIcon from '@material-ui/icons/Home'
|
import UsersIcon from '@material-ui/icons/People'
|
||||||
import BrowseIcon from '@material-ui/icons/ImportContacts'
|
import BrowseIcon from '@material-ui/icons/ImportContacts'
|
||||||
import SearchIcon from '@material-ui/icons/Search'
|
import SearchIcon from '@material-ui/icons/Search'
|
||||||
import ContactIcon from '@material-ui/icons/ContactMail'
|
import ContactIcon from '@material-ui/icons/ContactMail'
|
||||||
@@ -54,9 +54,6 @@ class NavBar extends Component {
|
|||||||
|
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
let user = localStorage.getItem('user')
|
let user = localStorage.getItem('user')
|
||||||
|
|
||||||
console.log('componentDidMount user', user)
|
|
||||||
|
|
||||||
let authId
|
let authId
|
||||||
|
|
||||||
if (user !== null && user !== undefined && user !== 'undefined') {
|
if (user !== null && user !== undefined && user !== 'undefined') {
|
||||||
@@ -64,8 +61,6 @@ class NavBar extends Component {
|
|||||||
authId = user.authId
|
authId = user.authId
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('componentDidMount authId', authId)
|
|
||||||
|
|
||||||
if (authId !== null && authId !== undefined && authId !== 'undefined') {
|
if (authId !== null && authId !== undefined && authId !== 'undefined') {
|
||||||
this.setState({ authId: authId })
|
this.setState({ authId: authId })
|
||||||
}
|
}
|
||||||
@@ -81,7 +76,7 @@ class NavBar extends Component {
|
|||||||
color='inherit'
|
color='inherit'
|
||||||
title='Home'
|
title='Home'
|
||||||
component={HomeLink}>
|
component={HomeLink}>
|
||||||
<HomeIcon />
|
<UsersIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<IconButton
|
<IconButton
|
||||||
className={classes.menuButton}
|
className={classes.menuButton}
|
||||||
|
|||||||
Reference in new issue
Block a user