Skip to content
Snippets Groups Projects
Commit ec5f9082 authored by Larbi Gharib's avatar Larbi Gharib
Browse files

Fix display user avatar

Change-Id: Ie1fe935ce317acf18aeb6ad859637aafb11715f2
parent 3c269261
Branches
No related tags found
No related merge requests found
...@@ -32,6 +32,8 @@ import PermIdentityOutlinedIcon from "@material-ui/icons/PermIdentityOutlined"; ...@@ -32,6 +32,8 @@ import PermIdentityOutlinedIcon from "@material-ui/icons/PermIdentityOutlined";
import Avatar from "@material-ui/core/Avatar"; import Avatar from "@material-ui/core/Avatar";
import Chip from "@material-ui/core/Chip"; import Chip from "@material-ui/core/Chip";
import DoneIcon from "@material-ui/icons/Done"; import DoneIcon from "@material-ui/icons/Done";
import CancelIcon from "@material-ui/icons/Cancel";
import CardAvatar from "components/Card/CardAvatar";
import List from "@material-ui/core/List"; import List from "@material-ui/core/List";
import ListItem from "@material-ui/core/ListItem"; import ListItem from "@material-ui/core/ListItem";
...@@ -200,36 +202,20 @@ export default function DisplayUserProfile(props) { ...@@ -200,36 +202,20 @@ export default function DisplayUserProfile(props) {
if (userStatus === false) { if (userStatus === false) {
return ( return (
<Chip <Chip
style={{ flex: 1 }}
label="Active" label="Active"
avatar={ variant="outlined"
<Avatar clickable={false}
alt={user.username}
src={
user.profilePicture
? "data:image/png;base64, " + user.profilePicture
: noProfilePicture
}
/>
}
color="primary"
deleteIcon={<DoneIcon />}
/> />
); );
} else { } else {
return ( return (
<Chip <Chip
style={{ flex: 1 }}
label="Revoked" label="Revoked"
avatar={ variant="outlined"
<Avatar clickable={false}
alt={user.username} disabled
src={
user.profilePicture
? "data:image/png;base64, " + user.profilePicture
: noProfilePicture
}
/>
}
deleteIcon={<DoneIcon />}
/> />
); );
} }
...@@ -302,18 +288,11 @@ export default function DisplayUserProfile(props) { ...@@ -302,18 +288,11 @@ export default function DisplayUserProfile(props) {
<GridContainer> <GridContainer>
<Grid item xs={12} sm={12} md={8}> <Grid item xs={12} sm={12} md={8}>
<Card profile> <Card profile>
<CardHeader color="info" stats icon>
<CardIcon color="info">
<PermIdentityOutlinedIcon />
</CardIcon>
<p className={classes.cardCategory}>{"Profile information"}</p>
<h3 className={classes.cardTitle}>{user.username}</h3>
{getUserStatus(user)}
</CardHeader>
<CardBody profile> <CardBody profile>
<div className={classes.root}> <div className={classes.root}>
<Grid container spacing={2}> <Grid container spacing={2}>
<Grid item align="center" xs={12} sm={12} md={12}> <Grid item xs={12} sm={12} md={6}>
<CardAvatar displayProfile>
<img <img
src={ src={
user.profilePicture user.profilePicture
...@@ -323,7 +302,15 @@ export default function DisplayUserProfile(props) { ...@@ -323,7 +302,15 @@ export default function DisplayUserProfile(props) {
className={classes.editProfilePicture} className={classes.editProfilePicture}
alt="..." alt="..."
/> />
<h4>{user.username ? user.username : "no username"}</h4> </CardAvatar>
</Grid>
<Grid item xs={12} sm={12} md={6}>
<h3 className={classes.cardTitle}>
{user.username ? user.username : "no username"}
</h3>
{getUserStatus(user)}
</Grid> </Grid>
<Grid item xs={12} sm={12} md={6}> <Grid item xs={12} sm={12} md={6}>
<List dense={false}> <List dense={false}>
...@@ -342,12 +329,14 @@ export default function DisplayUserProfile(props) { ...@@ -342,12 +329,14 @@ export default function DisplayUserProfile(props) {
<ListItem> <ListItem>
<ListItemAvatar> <ListItemAvatar>
<Avatar> <Avatar>
<PersonOutlinedIcon /> <PhoneInTalkOutlinedIcon />
</Avatar> </Avatar>
</ListItemAvatar> </ListItemAvatar>
<ListItemText <ListItemText
primary={ primary={
user.lastName ? user.lastName : "no lastname" user.phoneNumber
? user.phoneNumber
: "no phone number"
} }
/> />
</ListItem> </ListItem>
...@@ -383,14 +372,12 @@ export default function DisplayUserProfile(props) { ...@@ -383,14 +372,12 @@ export default function DisplayUserProfile(props) {
<ListItem> <ListItem>
<ListItemAvatar> <ListItemAvatar>
<Avatar> <Avatar>
<PhoneInTalkOutlinedIcon /> <PersonOutlinedIcon />
</Avatar> </Avatar>
</ListItemAvatar> </ListItemAvatar>
<ListItemText <ListItemText
primary={ primary={
user.phoneNumber user.lastName ? user.lastName : "no lastname"
? user.phoneNumber
: "no phone number"
} }
/> />
</ListItem> </ListItem>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment