diff --git a/apps/admin-x-settings/src/components/settings/growth/offers/OffersIndex.tsx b/apps/admin-x-settings/src/components/settings/growth/offers/OffersIndex.tsx index 290a4e12d4..a72b202961 100644 --- a/apps/admin-x-settings/src/components/settings/growth/offers/OffersIndex.tsx +++ b/apps/admin-x-settings/src/components/settings/growth/offers/OffersIndex.tsx @@ -91,22 +91,31 @@ const OfferCard: React.FC<{amount: number, cadence: string, currency: string, du const isTierArchived = offerTier?.active === false; return ( -
-
-

{name}

- {discountOffer} -
-
- {updatedPriceWithCurrency} - {originalPriceWithCurrency} -
-
-
- {tierName} - {redemptionCount} redemptions +
{}}> +
+
+

{name}

+ {discountOffer} +
+
+ {updatedPriceWithCurrency} + {originalPriceWithCurrency} +
+
+ + {!isTierArchived ? + : + null + }
-
+ {isTierArchived ? +
This offer is disabled, because
it is tied to an archived tier.
: + null + }
); }; @@ -144,10 +153,7 @@ export const OffersIndexModal = () => { modal.remove(); updateRoute(''); } - if (activeOffers.length === 0 && archivedOffers.length > 0) { - setSelectedTab('archived'); - } - }, [hasOffers, modal, updateRoute, activeOffers, archivedOffers, setSelectedTab]); + }, [hasOffers, modal, updateRoute]); const handleOfferEdit = (id:string) => { // TODO: implement @@ -230,13 +236,17 @@ export const OffersIndexModal = () => { const {discountColor, discountOffer, originalPriceWithCurrency, updatedPriceWithCurrency} = getOfferDiscount(offer.type, offer.amount, offer.cadence, offer.currency || 'USD', offerTier); return ( - - handleOfferEdit(offer?.id ? offer.id : '')}>{offer?.name} - handleOfferEdit(offer?.id ? offer.id : '')}>{offerTier.name} {getOfferCadence(offer.cadence)} - handleOfferEdit(offer?.id ? offer.id : '')}>{discountOffer} — {getOfferDuration(offer.duration)} - handleOfferEdit(offer?.id ? offer.id : '')}>{updatedPriceWithCurrency} {originalPriceWithCurrency} - {offer.redemption_count} - + + handleOfferEdit(offer?.id ? offer.id : '') : () => {}}>{offer?.name} + handleOfferEdit(offer?.id ? offer.id : '') : () => {}}>{offerTier.name} {getOfferCadence(offer.cadence)} + handleOfferEdit(offer?.id ? offer.id : '') : () => {}}>{discountOffer} — {getOfferDuration(offer.duration)} + handleOfferEdit(offer?.id ? offer.id : '') : () => {}}>{updatedPriceWithCurrency} {originalPriceWithCurrency} + {offer.redemption_count} + {!isTierArchived ? : null} + {isTierArchived ? +
This offer is disabled, because
it is tied to an archived tier.
: + null + } ); })}