Skip to content

Commit

Permalink
πŸš‘ Fix gifting (#1961)
Browse files Browse the repository at this point in the history
* πŸ› Fix missing computed props in gifting dialog

* πŸ› Fix undefined edition in gifting
  • Loading branch information
nwingt authored Nov 19, 2024
1 parent 58fa3cd commit 135078e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 35 deletions.
66 changes: 33 additions & 33 deletions src/components/NFTEditionSelectItemV2.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,41 +111,41 @@ export default {
showLabels() {
return this.isSoldOut || this.isLimitedStock || this.discountInfo;
},
},
cellClasses() {
return [
'group-hover:bg-like-cyan-light/[0.1]',
'group-active:bg-like-cyan-light/[0.2]',
'border-[2px]',
this.isInStock && this.isSelected
? 'border-like-cyan-light'
: 'border-transparent',
{ 'group-hover:border-like-cyan-light/50': !this.isSelected },
'transition-colors',
];
},
discountInfo() {
const originalPrice = this.defaultPrice;
const { currentPrice } = this;
if (!currentPrice || originalPrice <= currentPrice) {
return undefined;
}
cellClasses() {
return [
'group-hover:bg-like-cyan-light/[0.1]',
'group-active:bg-like-cyan-light/[0.2]',
'border-[2px]',
this.isInStock && this.isSelected
? 'border-like-cyan-light'
: 'border-transparent',
{ 'group-hover:border-like-cyan-light/50': !this.isSelected },
'transition-colors',
];
},
discountInfo() {
const originalPrice = this.defaultPrice;
const { currentPrice } = this;
if (!currentPrice || originalPrice <= currentPrice) {
return undefined;
}
const discountAmount = originalPrice - currentPrice;
const discountPercentage = Math.ceil(
(discountAmount / originalPrice) * 100
);
const discountAmount = originalPrice - currentPrice;
const discountPercentage = Math.ceil(
(discountAmount / originalPrice) * 100
);
return {
originalPriceLabel:
this.currency === 'HKD'
? formatNumberWithUnit(
Number((originalPrice * USD_TO_HKD_RATIO).toFixed(1)),
'HKD'
)
: formatNumberWithUSD(originalPrice),
discountPercentage,
};
return {
originalPriceLabel:
this.currency === 'HKD'
? formatNumberWithUnit(
Number((originalPrice * USD_TO_HKD_RATIO).toFixed(1)),
'HKD'
)
: formatNumberWithUSD(originalPrice),
discountPercentage,
};
},
},
};
</script>
4 changes: 2 additions & 2 deletions src/pages/nft/class/_classId/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1473,8 +1473,8 @@ export default {
await this.handleCollectFromEdition(this.giftSelectedValue, giftInfo);
this.isGiftDialogOpen = false;
},
handleGiftFromEditionSelector(selectedValue) {
this.giftSelectedValue = selectedValue;
handleGiftFromEditionSelector() {
this.giftSelectedValue = this.selectedValue;
this.isGiftDialogOpen = true;
logTrackerEvent(
this,
Expand Down

0 comments on commit 135078e

Please sign in to comment.