aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorilyayudovin <ilyayudovin123@gmail.com>2020-06-15 16:24:48 +0300
committerilyayudovin <ilyayudovin123@gmail.com>2020-06-15 18:26:48 +0300
commitfa2e3a5c0e8fabaa22587d04a55300d9b94157fe (patch)
treef40a3939cb39dfd7ddcb6a495136d937a8c38302
parentb860685d212200b5a46b7fea066306b851bf6e26 (diff)
downloadwhich-ui-fa2e3a5c0e8fabaa22587d04a55300d9b94157fe.tar.gz
fix: logout button display only at account owner
-rw-r--r--src/pages/ProfilePage/ProfileInfo.tsx7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/pages/ProfilePage/ProfileInfo.tsx b/src/pages/ProfilePage/ProfileInfo.tsx
index c2f242a..bddecd8 100644
--- a/src/pages/ProfilePage/ProfileInfo.tsx
+++ b/src/pages/ProfilePage/ProfileInfo.tsx
@@ -37,7 +37,6 @@ const useStyles = makeStyles({
const ProfileInfo: React.FC<PropTypes> = ({ user, logOut }) => {
const classes = useStyles();
-
return (
<div>
<Avatar className={classes.avatar} src={user?.avatarUrl} />
@@ -55,7 +54,11 @@ const ProfileInfo: React.FC<PropTypes> = ({ user, logOut }) => {
Following
</div>
</div>
- <Button variant="contained" onClick={logOut}>Log Out</Button>
+ {
+ user?._id === localStorage.getItem('userId')
+ ? <Button variant="contained" onClick={logOut}>Log Out</Button>
+ : null
+ }
</div>
);
};