Skip to content

Commit

Permalink
fix(ui): non clickable avatar if no issuer
Browse files Browse the repository at this point in the history
  • Loading branch information
ncarlier committed Sep 27, 2023
1 parent b3dc869 commit 6fdf255
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ui/src/components/UserInfos.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
background-color: rgba(0, 0, 0, 0.08);
}

.userInfos > a > img {
.userInfos img {
border-radius: 50%;
max-width: 48px;
}
Expand Down
14 changes: 8 additions & 6 deletions ui/src/components/UserInfos.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ import { AUTHORITY, CLIENT_ID } from '../config'
import { getAPIURL } from '../helpers'

const getAccountURL = () => {
if (AUTHORITY === 'mock') {
return ''
}
if (AUTHORITY.includes('realms')) {
// keycloak specifics
return `${AUTHORITY}/account?referrer=${CLIENT_ID}&referrer_uri=${encodeURI(document.location.href)}`
Expand All @@ -31,9 +28,14 @@ export const UserInfos = () => {
Member <TimeAgo dateTime={user.created_at} />
</small>
</span>
<a href={getAccountURL()} target="_blank" title="Go to my profile page">
<img src={getAPIURL(`/avatar/${user.hash}`)} alt={user.username} crossOrigin='anonymous' />
</a>
{
AUTHORITY !== 'none' ?
<a href={getAccountURL()} target="_blank" title="Go to my profile page">
<img src={getAPIURL(`/avatar/${user.hash}`)} alt={user.username} crossOrigin='anonymous' />
</a>
:
<img src={getAPIURL(`/avatar/${user.hash}`)} alt={user.username} crossOrigin='anonymous' />
}
</div>
)
}
Expand Down

0 comments on commit 6fdf255

Please sign in to comment.