-
-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5801 from Jarsen136/issue-5775
fix: Activity event improvements
- Loading branch information
Showing
8 changed files
with
134 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 0 additions & 39 deletions
39
components/collection/activity/events/eventRow/EventRowAvatar.vue
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.neo-avatar { | ||
max-width: none !important; | ||
object-fit: cover; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<template> | ||
<Story title="NeoAvatar"> | ||
<Variant title="Nft Avatar"> | ||
<NeoAvatar | ||
:avatar="image" | ||
:placeholder="image" | ||
:name="name" | ||
:size="size" /> | ||
</Variant> | ||
</Story> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import NeoAvatar from './NeoAvatar.vue' | ||
const image = | ||
'https://kodadot.mypinata.cloud/ipfs/bafybeigdh3ecetqmzplrjrovs5po23vwpikh2vgtfjai4vky5qzitjzaq4' | ||
const name = 'NFT Avatar' | ||
const size = 70 | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<template> | ||
<img | ||
v-if="avatar" | ||
:src="avatar" | ||
:alt="name" | ||
class="border neo-avatar" | ||
:style="customStyle" | ||
@error="onError" /> | ||
<img | ||
v-else | ||
:src="placeholder" | ||
:style="customStyle" | ||
class="border neo-avatar" /> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
const props = defineProps<{ | ||
avatar?: string | ||
placeholder: string | ||
name: string | ||
size: number | ||
}>() | ||
const customStyle = computed(() => ({ | ||
width: `${props.size}px`, | ||
height: `${props.size}px`, | ||
})) | ||
const onError = (e: Event) => { | ||
const target = e.target as HTMLImageElement | ||
if (target) { | ||
target.src = props.placeholder | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss"> | ||
@import './NeoAvatar.scss'; | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters