aboutsummaryrefslogtreecommitdiffstats
path: root/webui/src/components
diff options
context:
space:
mode:
authorLena <lena.becker-3@mni.thm.de>2021-03-11 15:57:54 +0100
committerSascha <GlancingMind@outlook.com>2021-04-13 19:07:57 +0200
commit134ac8aacd218630722a88bd0daaf346270edbff (patch)
tree9e58c30d507ec002d1553a74cce7a417e7a115b3 /webui/src/components
parente55761b2f8bdbb92ff77a7780bdd3b894d2a59ce (diff)
downloadgit-bug-134ac8aacd218630722a88bd0daaf346270edbff.tar.gz
12 Add code to dynamically switch depending on valuue for isProtected
Diffstat (limited to 'webui/src/components')
-rw-r--r--webui/src/components/CurrentIdentity/CurrentIdentity.tsx10
1 files changed, 8 insertions, 2 deletions
diff --git a/webui/src/components/CurrentIdentity/CurrentIdentity.tsx b/webui/src/components/CurrentIdentity/CurrentIdentity.tsx
index 2921e2bf..bec8d14f 100644
--- a/webui/src/components/CurrentIdentity/CurrentIdentity.tsx
+++ b/webui/src/components/CurrentIdentity/CurrentIdentity.tsx
@@ -11,6 +11,7 @@ import {
} from '@material-ui/core';
import Avatar from '@material-ui/core/Avatar';
import { makeStyles } from '@material-ui/core/styles';
+import LockIcon from '@material-ui/icons/Lock';
import { useCurrentIdentityQuery } from './CurrentIdentity.generated';
@@ -18,6 +19,9 @@ const useStyles = makeStyles((theme) => ({
displayName: {
marginLeft: theme.spacing(2),
},
+ hidden: {
+ display: 'none',
+ },
}));
const CurrentIdentity = () => {
@@ -30,6 +34,7 @@ const CurrentIdentity = () => {
if (error || loading || !data?.repository?.userIdentity) return null;
const user = data.repository.userIdentity;
+
const handleToggle = () => {
setOpen((prevOpen) => !prevOpen);
};
@@ -53,6 +58,7 @@ const CurrentIdentity = () => {
{user.displayName.charAt(0).toUpperCase()}
</Avatar>
</Button>
+ <LockIcon color="primary" className={!user.isProtected ? '' : ''} />
<Popper
open={open}
anchorEl={anchorRef.current}
@@ -77,8 +83,8 @@ const CurrentIdentity = () => {
</MenuItem>
<MenuItem>Email: {user.email ? user.email : 'none'}</MenuItem>
<MenuItem>Login: {user.login ? user.login : 'none'}</MenuItem>
- <MenuItem>
- Protected: {user.isProtected ? user.login : 'not set'}
+ <MenuItem className={user.isProtected ? '' : classes.hidden}>
+ Protected: {user.isProtected}
</MenuItem>
</MenuList>
</ClickAwayListener>