diff --git a/client/src/views/navbar/LoggedIn.js b/client/src/views/navbar/LoggedIn.js
index fd172000e..242feefb1 100644
--- a/client/src/views/navbar/LoggedIn.js
+++ b/client/src/views/navbar/LoggedIn.js
@@ -3,7 +3,6 @@ import PropTypes from 'prop-types'
import { Query } from 'react-apollo'
import LoggedInMenu from './LoggedInMenu'
-import { MessageCard } from '../common/'
import { UserClient } from '../../App'
import { USER_BY_AUTHID } from '../../graphql/members'
@@ -51,14 +50,18 @@ export const LoggedIn = props => {
{({ loading, error, data }) => {
console.log('USER_BY_AUTHID: ', loading, error, data)
+ if (loading) {
+ return
Loading...
+ }
+
if (error) {
error.graphQLErrors.map(({ message }, i) => {
- return
+ return {message}
})
}
return (
-
+
)
}}
diff --git a/client/src/views/navbar/LoggedInMenu.js b/client/src/views/navbar/LoggedInMenu.js
index dd0389983..6c1fb266c 100644
--- a/client/src/views/navbar/LoggedInMenu.js
+++ b/client/src/views/navbar/LoggedInMenu.js
@@ -1,16 +1,29 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
+import { withStyles } from '@material-ui/core/styles'
+
import Button from '@material-ui/core/Button'
import Menu from '@material-ui/core/Menu'
import MenuItem from '@material-ui/core/MenuItem'
+import Drawer from '@material-ui/core/Drawer'
import { Link } from 'react-router-dom'
import ProfileIcon from '@material-ui/icons/Person'
import LogoutIcon from '@material-ui/icons/DirectionsWalk'
-const UserLink = props =>
+import UserProfile from './Profile'
+
const LogoutLink = props =>
+const styles = {
+ drawer: {
+ width: 250
+ },
+ fullList: {
+ width: 'auto'
+ }
+}
+
class LoggedInUserMenu extends Component {
constructor (props) {
super(props)
@@ -18,14 +31,16 @@ class LoggedInUserMenu extends Component {
this.handleMenu = this.handleMenu.bind(this)
this.handleClose = this.handleClose.bind(this)
this.handleLogout = this.handleLogout.bind(this)
+ this.toggleDrawer = this.toggleDrawer.bind(this)
this.state = {
- menu: null
+ menu: null,
+ open: false
}
}
render () {
- const { menuLabel } = this.props
+ const { menuLabel, user, classes } = this.props
return (
)
}
@@ -67,11 +91,17 @@ class LoggedInUserMenu extends Component {
this.props.auth.logout()
this.setState({ menu: null })
}
+
+ toggleDrawer () {
+ this.setState({ open: !this.state.open })
+ }
}
LoggedInUserMenu.propTypes = {
+ classes: PropTypes.object.isRequired,
menuLabel: PropTypes.string.isRequired,
- auth: PropTypes.object.isRequired
+ auth: PropTypes.object.isRequired,
+ user: PropTypes.object
}
-export default LoggedInUserMenu
+export default withStyles(styles)(LoggedInUserMenu)
diff --git a/client/src/views/navbar/Profile.js b/client/src/views/navbar/Profile.js
new file mode 100644
index 000000000..adbef1761
--- /dev/null
+++ b/client/src/views/navbar/Profile.js
@@ -0,0 +1,94 @@
+import React, { Component } from 'react'
+import PropTypes from 'prop-types'
+
+// Materia UI
+
+import { withStyles } from '@material-ui/core/styles'
+import Button from '@material-ui/core/Button'
+import Grid from '@material-ui/core/Grid'
+import Card from '@material-ui/core/Card'
+import CardContent from '@material-ui/core/CardContent'
+import CardMedia from '@material-ui/core/CardMedia'
+import Typography from '@material-ui/core/Typography'
+import Divider from '@material-ui/core/Divider'
+
+// Images
+
+const styles = theme => ({
+ root: {
+ flexGrow: 1,
+ padding: 60,
+ margin: 2
+ },
+ card: {
+ maxWidth: 240,
+ minWidth: 240,
+ paddingTop: '30'
+ },
+ media: {
+ paddingTop: '56.25%', // 16:9,
+ marginTop: '30',
+ width: 100,
+ height: 100,
+ maxWidth: 100
+ },
+ grid: {
+ paddingTop: '30',
+ marginTop: '30'
+ },
+ typography: {
+ width: '100%',
+ marginTop: 20,
+ marginBottom: 20
+ }
+
+})
+
+class UserProfile extends Component {
+ render () {
+ const { classes, user, toggleDrawer } = this.props
+ return (
+
+
+
+
+
+
+
+
+ { user.firstName } { user.lastName } ( {user.alias} )
+
+
+
+
+ { user.role.name }
+
+
+
+
+ { user.bio }
+
+
+
+
+
+ )
+ }
+}
+
+UserProfile.propTypes = {
+ classes: PropTypes.object.isRequired,
+ user: PropTypes.object,
+ toggleDrawer: PropTypes.func
+}
+export default withStyles(styles)(UserProfile)