Skip to content

Commit 1d6a848

Browse files
committed
modal tweaking
1 parent a0db427 commit 1d6a848

File tree

4 files changed

+27
-61
lines changed

4 files changed

+27
-61
lines changed

src/ui/components/Checkout/ModalCheckout.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const props = defineProps<{
1212
modalClose?: () => void
1313
name: string | undefined
1414
description: string | undefined
15-
image: HTMLImageElement | undefined
1615
imageSrc: string | undefined
1716
videoSrc: string | undefined
1817
}>()
@@ -141,13 +140,13 @@ onMounted(async () => {
141140
</h3>
142141
<!-- image -->
143142
<img
144-
v-if="!image && imageSrc"
143+
v-if="imageSrc"
145144
:src="imageSrc"
146145
class="z-10 max-h-60 min-h-full max-w-60 object-contain @xl/clb_result_modal:max-h-none @xl/clb_result_modal:max-w-xl"
147146
/>
148147
<!-- video -->
149148
<video
150-
v-if="!image && !imageSrc && videoSrc"
149+
v-if="!imageSrc && videoSrc"
151150
class="max-w-60 rounded"
152151
autoplay
153152
muted
@@ -198,6 +197,7 @@ onMounted(async () => {
198197
{{ i18n('Home') }}
199198
</a>
200199
<button
200+
v-if="false /* HIDDEN FOR NOW */"
201201
@click="modalClose"
202202
class="hs-button is-filled rounded-lg border px-12 py-4 text-base @4xl/clb_result_modal:py-6"
203203
>

src/ui/components/Checkout/Result.vue

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
<script lang="ts" setup>
22
import { 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'
84
import { JsonRpcProvider } from 'ethers'
95
import Skeleton from '../Skeleton/Skeleton.vue'
106
import { clientsSTokens } from '@devprotocol/dev-kit'
@@ -52,7 +48,6 @@ const tokenURI = ref<
5248
]
5349
}>
5450
>()
55-
const image = ref<HTMLImageElement>()
5651
const 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">

src/ui/components/Checkout/i18n/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ export const Strings = {
4949
en: ([currency]) => `Pay with ${currency}`,
5050
ja: ([currency]) => `次の貨幣で支払う:${currency}`,
5151
},
52-
Minted: {
53-
en: 'Minted',
54-
ja: '発行されました',
55-
},
5652
AutomaticStaking: {
5753
en: ([amount]) => `${amount} DEV will be staked automatically.`,
5854
ja: ([amount]) => `${amount} DEVは自動的にステーキングされます。`,

src/ui/components/Modal.vue

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -43,27 +43,25 @@ html:has(dialog[open]) {
4343
</style>
4444

4545
<template>
46-
<div>
47-
<dialog
48-
ref="dialog"
49-
class="fixed inset-0 flex items-center justify-center overflow-y-auto backdrop:bg-black/60"
50-
:class="{ hidden: !isVisible }"
51-
>
52-
<Transition>
53-
<div class="relative m-auto w-full py-4">
54-
<component
55-
:eoa="eoa"
56-
:modalClose="modalClose"
57-
v-show="isVisible"
58-
:is="modalContent"
59-
v-bind="attrs"
60-
>
61-
<template #after:description>
62-
<slot name="after:description" />
63-
</template>
64-
</component>
65-
</div>
66-
</Transition>
67-
</dialog>
68-
</div>
46+
<dialog
47+
ref="dialog"
48+
class="fixed inset-0 flex items-center justify-center overflow-y-auto backdrop:bg-black/60"
49+
:class="{ hidden: !isVisible }"
50+
>
51+
<Transition>
52+
<div class="relative m-auto w-full py-4">
53+
<component
54+
:eoa="eoa"
55+
:modalClose="modalClose"
56+
v-show="isVisible"
57+
:is="modalContent"
58+
v-bind="attrs"
59+
>
60+
<template #after:description>
61+
<slot name="after:description" />
62+
</template>
63+
</component>
64+
</div>
65+
</Transition>
66+
</dialog>
6967
</template>

0 commit comments

Comments
 (0)