Placeholder avatar is incosistent across components #39

Merged
s merged 9 commits from issue-27 into main 2024-05-16 08:58:11 +00:00
Showing only changes of commit 5e114f7fb8 - Show all commits

View File

@ -17,6 +17,7 @@ import { MetadataController } from '../../controllers'
import { getProfileRoute } from '../../routes'
import { Meta, ProfileMetadata } from '../../types'
import {
getRoboHashPicture,
hexToNpub,
parseJson,
readContentOfZipEntry,
@ -112,8 +113,9 @@ export const VerifyPage = () => {
setIsLoading(false)
}
const imageLoadError = (event: any) => {
event.target.src = placeholderAvatar
const imageLoadError = (event: any, pubkey: string) => {
const npub = hexToNpub(pubkey)
event.target.src = npub
}
const getRoboImageUrl = (pubkey: string) => {
@ -143,7 +145,7 @@ export const VerifyPage = () => {
return (
<Box className={styles.user}>
<img
onError={imageLoadError}
onError={(event) => {imageLoadError(event, pubkey)}}
src={profile?.picture || getRoboImageUrl(pubkey)}
alt="Profile Image"
className="profile-image"