Use avatar picture when it exists (#3195)

This commit is contained in:
Erik Jan de Wit 2022-08-30 11:02:50 +02:00 committed by GitHub
parent e84ff41654
commit e6fc51f435
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -89,6 +89,8 @@ export const Header = () => {
];
const headerTools = () => {
const adminClient = useAdminClient();
const picture = adminClient.keycloak.tokenParsed?.picture;
return (
<PageHeaderTools>
<PageHeaderToolsGroup
@ -120,7 +122,7 @@ export const Header = () => {
</PageHeaderToolsItem>
</PageHeaderToolsGroup>
<Avatar
src={environment.resourceUrl + "/img_avatar.svg"}
src={picture || environment.resourceUrl + "/img_avatar.svg"}
alt="Avatar image"
/>
</PageHeaderTools>