Skip to content

Commit

Permalink
Merge pull request #11030 from hassnian/issue-11028
Browse files Browse the repository at this point in the history
  • Loading branch information
vikiival authored Oct 7, 2024
2 parents 6dcd66d + d3432b0 commit f58cda2
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 10 deletions.
5 changes: 4 additions & 1 deletion components/offer/OfferOverviewModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@
{{ $t('expiration') }}
</span>

<span>
<span v-if="offer.status === 'EXPIRED'">
{{ $t('expired') }}
</span>
<span v-else>
{{ offer.expirationDate ? formatToNow(offer.expirationDate, false) : '' }}
</span>
</div>
Expand Down
9 changes: 9 additions & 0 deletions components/offer/OwnerButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ const { isOwnerOfNft, isOwnerOfOffer } = useIsOffer(computed(() => props.offer),
const onClick = () => emit('click', props.offer)
const buttonConfig = computed<ButtonConfig | null>(() => {
if (props.offer.status === 'EXPIRED') {
return isOwnerOfOffer.value
? {
label: $i18n.t('offer.withdrawAmount'),
onClick,
}
: null
}
if (isOwnerOfOffer.value) {
return {
label: $i18n.t('transaction.offerWithdraw'),
Expand Down
26 changes: 18 additions & 8 deletions components/profile/activityTab/OfferRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,15 @@

<div class="flex-1">
<div class="h-[50px] flex items-center">
<div v-if="offer.expirationDate">
<span> {{ format(offer.expirationDate, EXPIRATION_FORMAT) }}</span>
<span class="text-k-grey ml-3"> ({{ formatToNow(offer.expirationDate, isExpired) }})</span>
</div>
<template v-if="offer.expirationDate">
<div v-if="isExpired">
<span>{{ $t('expired') }}</span>
</div>
<div v-else>
<span>{{ format(offer.expirationDate, EXPIRATION_FORMAT) }}</span>
<span class="text-k-grey ml-3">({{ formatToNow(offer.expirationDate, isExpired) }})</span>
</div>
</template>
<span v-else>
{{ blank }}
</span>
Expand Down Expand Up @@ -139,10 +144,15 @@
<div v-else>
{{ blank }}
</div>
<div v-if="offer.expirationDate">
<span> {{ format(offer.expirationDate, EXPIRATION_FORMAT) }}</span>
<span class="text-k-grey ml-3"> ({{ formatToNow(offer.expirationDate, isExpired) }})</span>
</div>
<template v-if="offer.expirationDate">
<div v-if="isExpired">
<span>{{ $t('expired') }}</span>
</div>
<div v-else>
<span>{{ format(offer.expirationDate, EXPIRATION_FORMAT) }}</span>
<span class="text-k-grey ml-3">({{ formatToNow(offer.expirationDate, isExpired) }})</span>
</div>
</template>
<span v-else>
{{ blank }}
</span>
Expand Down
2 changes: 1 addition & 1 deletion components/profile/activityTab/Offers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<span> {{ $t(`activity.event.${tabTarget}`) }} </span>
</div>
<div class="flex-1">
<span>{{ $t('activity.event.time') }}</span>
<span>{{ $t('expiration') }}</span>
</div>
<div class="flex-1">
<span />
Expand Down
2 changes: 2 additions & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@
}
},
"expiration": "Expiration",
"expired": "Expired",
"explore": "Explore",
"exploreCollections": "Explore Collections on",
"exploreItems": "Explore Items on",
Expand Down Expand Up @@ -1489,6 +1490,7 @@
"offerFees": "Offer Fee",
"offerWithdrawl": "Offer Cancelation",
"typeOffer": "Type An Offer",
"withdrawAmount": "Withdraw Amount",
"yourOffer": "Your Offer",
"yourOfferAmount": "Your Offer Amount"
},
Expand Down

0 comments on commit f58cda2

Please sign in to comment.