From 5f38aac3f2500668b5d63cc374f10abff9909f91 Mon Sep 17 00:00:00 2001 From: hassnian Date: Mon, 5 Aug 2024 12:01:39 +0500 Subject: [PATCH 1/2] add(BasicDropCard.vue): `price` section --- components/drops/BasicDropCard.vue | 28 +++++++++++++++++---- components/drops/DropCard.vue | 1 + components/drops/DropCardSkeleton.vue | 2 +- components/drops/calendar/DropsCalendar.vue | 1 + composables/useAmount.ts | 2 +- 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/components/drops/BasicDropCard.vue b/components/drops/BasicDropCard.vue index 8912861b74..9ac368371d 100644 --- a/components/drops/BasicDropCard.vue +++ b/components/drops/BasicDropCard.vue @@ -45,11 +45,20 @@
- -
- {{ minted }}/{{ dropMax }} +
+ +
+ {{ minted }}/{{ dropMax }} +
+
+
+ {{ formattedPrice }}USD
- +
+ import type { Prefix } from '@kodadot1/static' import type { DropStatus } from '@/components/drops/useDrops' +import { chainPropListOf } from '@/utils/config/chain.config' const emit = defineEmits(['click']) -withDefaults( +const props = withDefaults( defineProps<{ image: string | undefined name: string @@ -91,6 +101,7 @@ withDefaults( minted?: number ownerAddresses?: string[] dropCreator?: string | null + dropPrice?: string }>(), { loading: false, @@ -107,6 +118,13 @@ withDefaults( ) const { placeholder } = useTheme() + +const chainPropList = chainPropListOf(props.dropPrefix) +const { usd: formattedPrice } = useAmount( + computed(() => props.dropPrice), + toRef(chainPropList.tokenDecimals), + toRef(chainPropList.tokenSymbol), +)