diff options
author | ilyayudovin <ilyayudovin123@gmail.com> | 2020-06-25 21:48:05 +0300 |
---|---|---|
committer | ilyayudovin <ilyayudovin123@gmail.com> | 2020-06-25 21:48:05 +0300 |
commit | 9852ed44fca2c71e6992e583d4cd3b874b6b18fa (patch) | |
tree | f57a8ff735118af10d5f3c61005eaa6ce8815c99 /src/pages/ProfilePage/ProfileInfo.tsx | |
parent | cb88b8fde92772c5de4eb36cea88c69d7a879d93 (diff) | |
download | which-ui-9852ed44fca2c71e6992e583d4cd3b874b6b18fa.tar.gz |
upload photo icon appear only on yours profile
Diffstat (limited to 'src/pages/ProfilePage/ProfileInfo.tsx')
-rw-r--r-- | src/pages/ProfilePage/ProfileInfo.tsx | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/src/pages/ProfilePage/ProfileInfo.tsx b/src/pages/ProfilePage/ProfileInfo.tsx index 2d2c67b..18a9fca 100644 --- a/src/pages/ProfilePage/ProfileInfo.tsx +++ b/src/pages/ProfilePage/ProfileInfo.tsx @@ -14,6 +14,7 @@ const useStyles = makeStyles({ avatar: { width: 150, height: 150, + margin: '0 auto' }, name: { fontSize: 20, @@ -57,18 +58,22 @@ const ProfileInfo: React.FC<PropTypes> = ({ user, logOut }) => { const classes = useStyles(); return ( <div> - <div className={classes.avatarContainer}> - <StyledBadge - overlap="circle" - anchorOrigin={{ - vertical: 'bottom', - horizontal: 'right', - }} - badgeContent={<CameraAltIcon />} - > - <Avatar className={classes.avatar} src={user?.avatarUrl} /> - </StyledBadge> - </div> + { + user?._id === localStorage.getItem('userId') + ? <div className={classes.avatarContainer}> + <StyledBadge + overlap="circle" + anchorOrigin={{ + vertical: 'bottom', + horizontal: 'right', + }} + badgeContent={<CameraAltIcon />} + > + <Avatar className={classes.avatar} src={user?.avatarUrl} /> + </StyledBadge> + </div> + : <Avatar className={classes.avatar} src={user?.avatarUrl} /> + } <div className={classes.name}> {user?.username} </div> |