11<script lang="ts" setup>
22import { onMounted , ref , type ComputedRef , computed } from ' vue'
3- import {
4- type UndefinedOr ,
5- whenDefined ,
6- whenDefinedAll ,
7- } from ' @devprotocol/util-ts'
3+ import { type UndefinedOr , whenDefinedAll } from ' @devprotocol/util-ts'
84import { JsonRpcProvider } from ' ethers'
95import Skeleton from ' ../Skeleton/Skeleton.vue'
106import { clientsSTokens } from ' @devprotocol/dev-kit'
@@ -52,7 +48,6 @@ const tokenURI = ref<
5248 ]
5349 }>
5450> ()
55- const image = ref <HTMLImageElement >()
5651const htmlDescription: ComputedRef <UndefinedOr <string >> = computed (() => {
5752 return (
5853 tokenURI .value ?.description && markdownToHtml (tokenURI .value .description )
@@ -82,13 +77,6 @@ onMounted(async () => {
8277 client .tokenURI (Number (id ))
8378 )
8479 tokenURI .value = metadata
85- whenDefined (metadata ?.image , (src ) => {
86- const img = new Image ()
87- img .onload = () => {
88- image .value = img
89- }
90- img .src = src
91- })
9280 console .log ({ metadata })
9381
9482 // Modal Open
@@ -104,10 +92,6 @@ onMounted(async () => {
10492 class =" -mx-8 grid gap-8 bg-dp-white-300 p-6 md:mx-auto md:w-full md:rounded-md"
10593 >
10694 <div class =" flex flex-col gap-6" >
107- <p class =" font-mono font-bold" >
108- {{ i18n('Minted') }} <span class =" text-black/50" >#{{ id }}</span >
109- </p >
110-
11195 <!-- me -->
11296 <Modal
11397 :eoa =" eoa "
@@ -117,7 +101,6 @@ onMounted(async () => {
117101 :attrs =" {
118102 name: tokenURI ?.name ,
119103 description: htmlDescription ,
120- image: image ,
121104 imageSrc ,
122105 videoSrc ,
123106 } "
@@ -129,31 +112,20 @@ onMounted(async () => {
129112
130113 <div class =" rounded-lg border border-black/20 bg-black/10 p-4" >
131114 <img
132- v-if =" !image && imageSrc"
115+ v-if =" imageSrc"
133116 :src =" imageSrc"
134117 class =" h-auto w-full rounded object-cover object-center sm:h-full sm:w-full"
135118 />
136- <img
137- v-if =" image"
138- :src =" image.src"
139- :width =" image.width"
140- :height =" image.height"
141- class =" h-auto w-full rounded object-cover object-center sm:h-full sm:w-full"
142- />
143119 <!-- video -->
144120 <video
145- v-if =" !image && ! imageSrc && videoSrc"
121+ v-if =" !imageSrc && videoSrc"
146122 class =" w-full rounded"
147123 autoplay
148124 muted
149125 >
150126 <source :src =" videoSrc" type =" video/mp4" />
151127 Your browser does not support the video tag.
152128 </video >
153- <Skeleton
154- v-if =" image === undefined "
155- class="mx-auto aspect-square h-full w-full"
156- />
157129 </div >
158130 <span >
159131 <h3 class =" break-all text-sm text-black/50" >
0 commit comments