From 7112fea81917fb17dcb004b7c105c7585cda6a2b Mon Sep 17 00:00:00 2001 From: hassnian Date: Mon, 23 Sep 2024 13:19:28 +0500 Subject: [PATCH 1/4] fix(offers): show `EXPIRED` offer expiration date as `expired` --- components/offer/OfferOverviewModal.vue | 5 +++- components/profile/activityTab/OfferRow.vue | 26 ++++++++++++++------- components/profile/activityTab/Offers.vue | 2 +- locales/en.json | 1 + 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/components/offer/OfferOverviewModal.vue b/components/offer/OfferOverviewModal.vue index 51283e4d46..735500b521 100644 --- a/components/offer/OfferOverviewModal.vue +++ b/components/offer/OfferOverviewModal.vue @@ -58,7 +58,10 @@ {{ $t('expiration') }} - + + {{ $t('expired') }} + + {{ offer.expirationDate ? formatToNow(offer.expirationDate, false) : '' }} diff --git a/components/profile/activityTab/OfferRow.vue b/components/profile/activityTab/OfferRow.vue index 5d77f4750c..037f5dd11f 100644 --- a/components/profile/activityTab/OfferRow.vue +++ b/components/profile/activityTab/OfferRow.vue @@ -74,10 +74,15 @@
-
- {{ format(offer.expirationDate, EXPIRATION_FORMAT) }} - ({{ formatToNow(offer.expirationDate, isExpired) }}) -
+ {{ blank }} @@ -139,10 +144,15 @@
{{ blank }}
-
- {{ format(offer.expirationDate, EXPIRATION_FORMAT) }} - ({{ formatToNow(offer.expirationDate, isExpired) }}) -
+ {{ blank }} diff --git a/components/profile/activityTab/Offers.vue b/components/profile/activityTab/Offers.vue index 1a253ef466..534550bbd5 100644 --- a/components/profile/activityTab/Offers.vue +++ b/components/profile/activityTab/Offers.vue @@ -49,7 +49,7 @@ {{ $t(`activity.event.${tabTarget}`) }}
- {{ $t('activity.event.time') }} + {{ $t('expiration') }}
diff --git a/locales/en.json b/locales/en.json index ebc9be8812..6ae57bbc22 100644 --- a/locales/en.json +++ b/locales/en.json @@ -7,6 +7,7 @@ "artist": "Artist", "offers": "Offers", "expiration": "Expiration", + "expired": "Expired", "markdownSupported": "Markdown supported", "why": "Why", "requirements": "Requirements", From 89c6723c2d8d3cf5656e891f2d3d67cf83f4b240 Mon Sep 17 00:00:00 2001 From: hassnian Date: Mon, 23 Sep 2024 13:23:03 +0500 Subject: [PATCH 2/4] fix(OwnerButton.vue): show `withdraw amount` when offer is expired --- components/offer/OwnerButton.vue | 9 +++++++++ locales/en.json | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/components/offer/OwnerButton.vue b/components/offer/OwnerButton.vue index 714978370b..b1ee50f8f5 100644 --- a/components/offer/OwnerButton.vue +++ b/components/offer/OwnerButton.vue @@ -20,6 +20,15 @@ const { isOwnerOfNft, isOwnerOfOffer } = useIsOffer(computed(() => props.offer), const onClick = () => emit('click', props.offer) const buttonConfig = computed(() => { + if (props.offer.status === 'EXPIRED') { + return isOwnerOfOffer.value + ? { + label: $i18n.t('offer.withdrawAmount'), + onClick, + } + : null + } + if (isOwnerOfOffer.value) { return { label: $i18n.t('transaction.offerWithdraw'), diff --git a/locales/en.json b/locales/en.json index 6ae57bbc22..f54be18b40 100644 --- a/locales/en.json +++ b/locales/en.json @@ -1653,7 +1653,8 @@ "floorDifference": "Floor Difference", "incomingOffer": "Incoming Offer", "offerWithdrawl": "Offer Cancelation", - "offerAccept": "Accepting Offer" + "offerAccept": "Accepting Offer", + "withdrawAmount": "Withdraw Amount" }, "migrate": { "cta": "Migrate Now", From 459bec434a5d71294df4d33d087b8071a577c05a Mon Sep 17 00:00:00 2001 From: hassnian Date: Mon, 23 Sep 2024 13:26:44 +0500 Subject: [PATCH 3/4] ref(OfferRow.vue): reuse `ieExpired` computed --- components/profile/activityTab/OfferRow.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/profile/activityTab/OfferRow.vue b/components/profile/activityTab/OfferRow.vue index 037f5dd11f..5ad756f6f0 100644 --- a/components/profile/activityTab/OfferRow.vue +++ b/components/profile/activityTab/OfferRow.vue @@ -75,7 +75,7 @@