issue-38 #62

Closed
y wants to merge 48 commits from issue-38 into main
Showing only changes of commit f80df772f8 - Show all commits

View File

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