Skip to content

Commit

Permalink
fix: Profile: If follower doesnt have profile picture leave that Polk…
Browse files Browse the repository at this point in the history
…adot wallet picture
  • Loading branch information
Jarsen136 committed Jul 4, 2024
1 parent d9109e9 commit 2a13ea5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
14 changes: 7 additions & 7 deletions components/profile/ProfileDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,13 @@
<div
v-for="(follower, index) in followers?.followers"
:key="index"
:style="{ zIndex: 3 - index }"
class="w-8 h-8 flex-shrink-0 rounded-full border">
<BasicImage
:src="follower.image"
custom-class="object-cover"
alt="follower avatar"
rounded />
class="flex"
:style="{ zIndex: 3 - index }">
<ProfileAvatar
class="border"
:profile-image="follower.image"
:address="follower.address"
:size="30" />
</div>
</div>
</NeoButton>
Expand Down
14 changes: 11 additions & 3 deletions components/shared/ProfileAvatar.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<template>
<div
v-if="profile?.image"
v-if="profileImageUrl"
class="rounded-full overflow-hidden bg-background-color border"
:style="{
width: `${size}px`,
height: `${size}px`,
padding: `${Math.round(size / 16)}px`,
}">
<BaseMediaItem
:src="profile?.image"
:src="profileImageUrl"
:image-component="NuxtImg"
title="User Avatar"
class="object-cover overflow-hidden rounded-full h-full w-full !shadow-none" />
Expand All @@ -22,13 +22,21 @@ const NuxtImg = resolveComponent('NuxtImg')
const props = withDefaults(
defineProps<{
address: string
profileImage?: string
size?: number
}>(),
{
value: '',
profileImage: undefined,
size: 64,
},
)
const { profile } = useFetchProfile(props.address)
const { profile: profileFromAddress } = useFetchProfile(
props.profileImage ? undefined : props.address,
)
const profileImageUrl = computed(
() => props.profileImage || profileFromAddress.value?.image,
)
</script>

0 comments on commit 2a13ea5

Please sign in to comment.