Skip to content

Commit

Permalink
fix: send nft page img url display issue
Browse files Browse the repository at this point in the history
  • Loading branch information
AricRedemption committed Nov 13, 2024
1 parent 8945f89 commit dc2b246
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
27 changes: 12 additions & 15 deletions src/pages/nfts/MetaPinDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,6 @@ const metaPinId = ref(params.metaPinId as string)
const { data: metaPin, isLoading } = useMetaPinQuery(metaPinId, { enabled: computed(() => !!address) })
const toSendNFT = (id: string) => {
router.push({
name: 'sendNFT',
params: { id, nftType: 'metaPin' },
query: {
satoshis: metaPin.value?.outputValue,
content: metaPin.value?.contentSummary,
imgUrl:
metaPin.value?.contentType.includes('image') || metaPin.value?.contentTypeDetect.includes('image')
? metaPin.value?.content
: undefined,
},
})
}
const getHostAndToTx = async (txId: string) => {
const host = await getBrowserHost('btc')
toTx(txId, host as string)
Expand Down Expand Up @@ -65,6 +50,18 @@ const imageSrc = computed(() => {
}
return ''
})
const toSendNFT = (id: string) => {
router.push({
name: 'sendNFT',
params: { id, nftType: 'metaPin' },
query: {
imgUrl: imageSrc.value,
satoshis: metaPin.value?.outputValue,
content: metaPin.value?.contentSummary,
},
})
}
</script>

<template>
Expand Down
11 changes: 7 additions & 4 deletions src/pages/nfts/SendNFT.vue
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@ operationLock.value = false
</div>
<span
:class="[
'absolute rounded right-0 bottom-1 py-3px px-1.5 text-xs scale-75',
imgUrl ? 'bg-[#EBECFF] text-[#787FFF]' : 'bg-[rgb(235,236,255,0.2) text-[#EBECFF]',
'absolute rounded right-0 bottom-1 py-3px px-1.5 text-xs scale-75 bg-[#E2F4FF]/80 text-[#1472FF]',
]"
>
{{ satoshis }} sat
Expand Down Expand Up @@ -260,8 +259,12 @@ operationLock.value = false
</div>
</div>
<div class="flex items-center justify-center gap-x-2">
<button @click="cancel" class="w-30 rounded-3xl bg-blue-light py-4 text-ss text-blue-primary">{{ $t('Common.Cancel') }}</button>
<button @click="send" class="w-30 rounded-3xl bg-blue-primary py-4 text-ss text-white">{{ $t('Common.Confirm') }}</button>
<button @click="cancel" class="w-30 rounded-3xl bg-blue-light py-4 text-ss text-blue-primary">
{{ $t('Common.Cancel') }}
</button>
<button @click="send" class="w-30 rounded-3xl bg-blue-primary py-4 text-ss text-white">
{{ $t('Common.Confirm') }}
</button>
</div>
</div>
</div>
Expand Down

0 comments on commit dc2b246

Please sign in to comment.