diff --git a/client/src/components/UserProfile.js b/client/src/components/UserProfile.js index 21906da18..7efc09a8c 100644 --- a/client/src/components/UserProfile.js +++ b/client/src/components/UserProfile.js @@ -23,7 +23,8 @@ const styles = theme => ({ margin: 2 }, card: { - width: '80%', + maxWidth: 500, + minWidth: 500, paddingTop: '30' }, media: { @@ -46,6 +47,51 @@ const styles = theme => ({ class UserProfile extends Component { + displayNames () { + const user = this.props.data.users_User + const { classes } = this.props + + if (user.firstName !== null && user.lastName !== null) { + return ( + + { user.firstName + ' ' + user.lastName} + + ) + } + } + + displayRole () { + const user = this.props.data.users_User + const { classes } = this.props + + if (user.role.name !== null && user.role.name !== 'Not Defined') { + return ( +
+ + + { user.role.name } + +
+ ) + } + } + + displayBio () { + const user = this.props.data.users_User + const { classes } = this.props + + if (user.bio !== null && user.bio !== '') { + return ( +
+ + + { user.bio } + +
+ ) + } + } + displayUserProfile () { const user = this.props.data.users_User const { classes } = this.props @@ -66,19 +112,16 @@ class UserProfile extends Component { /> - - { user.firstName } { user.lastName } ( {user.alias} ) - - - - { user.role.name } - - + {this.displayNames()} - - { user.bio } + + {user.alias} + + {this.displayRole()} + {this.displayBio()} +