diff options
author | Michael Muré <batolettre@gmail.com> | 2021-04-23 00:16:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-23 00:16:57 +0200 |
commit | a8f3b55986982db5f7c3918acaba2c214c919d11 (patch) | |
tree | 19706066a71c32684979b019aa62525481ff4891 /webui/src/components/CurrentIdentity/CurrentIdentity.tsx | |
parent | 271ca35d19a9649f6d0512760aed70c8778822fc (diff) | |
parent | 774bae6d432c13cfa0de3ddc2f111927743243fe (diff) | |
download | git-bug-a8f3b55986982db5f7c3918acaba2c214c919d11.tar.gz |
Merge pull request #605 from GlancingMind/upstream-12-allow-users-to-inspect-their-current-identity-details
WebUI: Add user profile
Diffstat (limited to 'webui/src/components/CurrentIdentity/CurrentIdentity.tsx')
-rw-r--r-- | webui/src/components/CurrentIdentity/CurrentIdentity.tsx | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/webui/src/components/CurrentIdentity/CurrentIdentity.tsx b/webui/src/components/CurrentIdentity/CurrentIdentity.tsx deleted file mode 100644 index 8cd3585b..00000000 --- a/webui/src/components/CurrentIdentity/CurrentIdentity.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import React from 'react'; - -import Avatar from '@material-ui/core/Avatar'; -import { makeStyles } from '@material-ui/core/styles'; - -import { useCurrentIdentityQuery } from './CurrentIdentity.generated'; - -const useStyles = makeStyles((theme) => ({ - displayName: { - marginLeft: theme.spacing(2), - }, -})); - -const CurrentIdentity = () => { - const classes = useStyles(); - const { loading, error, data } = useCurrentIdentityQuery(); - - if (error || loading || !data?.repository?.userIdentity) return null; - - const user = data.repository.userIdentity; - return ( - <> - <Avatar src={user.avatarUrl ? user.avatarUrl : undefined}> - {user.displayName.charAt(0).toUpperCase()} - </Avatar> - <div className={classes.displayName}>{user.displayName}</div> - </> - ); -}; - -export default CurrentIdentity; |