feat: expand default avatar
This commit is contained in:
@@ -69,8 +69,12 @@ export const CommentItem = ({
|
||||
className="block align-middle mr-3"
|
||||
>
|
||||
<Avatar
|
||||
cid={comment?.character?.characterId}
|
||||
images={comment?.character?.metadata?.content?.avatars || []}
|
||||
cid={displayName || comment?.character?.characterId}
|
||||
images={
|
||||
displayName
|
||||
? []
|
||||
: comment?.character?.metadata?.content?.avatars || []
|
||||
}
|
||||
name={
|
||||
displayName || comment?.character?.metadata?.content?.name
|
||||
}
|
||||
|
||||
@@ -38,10 +38,6 @@ export const Avatar = ({
|
||||
image = `https://api.dicebear.com/6.x/bottts-neutral/svg?seed=${cid}`
|
||||
}
|
||||
|
||||
if (cid === 56592) {
|
||||
image = `https://api.dicebear.com/6.x/bottts-neutral/svg?seed=${name}`
|
||||
}
|
||||
|
||||
return (
|
||||
<span
|
||||
{...props}
|
||||
|
||||
@@ -151,12 +151,17 @@ export const expandCrossbellCharacter = (site: CharacterEntity) => {
|
||||
expandedCharacter.metadata.content.name =
|
||||
expandedCharacter.metadata.content.name || expandedCharacter.handle
|
||||
|
||||
if (expandedCharacter.metadata.content.avatars) {
|
||||
if (expandedCharacter.metadata.content.avatars?.length) {
|
||||
expandedCharacter.metadata.content.avatars =
|
||||
expandedCharacter.metadata.content.avatars
|
||||
.map((avatar) => toGateway(avatar))
|
||||
.filter(Boolean)
|
||||
} else {
|
||||
expandedCharacter.metadata.content.avatars = [
|
||||
`https://api.dicebear.com/6.x/bottts-neutral/svg?seed=${expandedCharacter.characterId}`,
|
||||
]
|
||||
}
|
||||
|
||||
if (expandedCharacter.metadata.content.banners) {
|
||||
expandedCharacter.metadata.content.banners =
|
||||
expandedCharacter.metadata.content.banners
|
||||
|
||||
Reference in New Issue
Block a user