diff --git a/apps/admin-x-settings/src/components/settings/growth/Offers.tsx b/apps/admin-x-settings/src/components/settings/growth/Offers.tsx index f5e6043481..9b504f7934 100644 --- a/apps/admin-x-settings/src/components/settings/growth/Offers.tsx +++ b/apps/admin-x-settings/src/components/settings/growth/Offers.tsx @@ -57,15 +57,34 @@ const Offers: React.FC<{ keywords: string[] }> = ({keywords}) => { updateRoute('offers/new'); }; + const openTiers = () => { + updateRoute('/tiers'); + }; + const goToOfferEdit = (offerId: string) => { sessionStorage.setItem('editOfferPageSource', 'offers'); updateRoute(`offers/edit/${offerId}`); }; + let offerButtonText = 'Manage offers'; + let offerButtonLink = openOfferListModal; + let descriptionButtonText = 'Learn more'; + if (allOffers.length > 0) { + offerButtonText = 'Manage offers'; + offerButtonLink = openOfferListModal; + } else if (paidActiveTiers.length === 0 && allOffers.length === 0) { + offerButtonText = ''; + offerButtonLink = openTiers; + descriptionButtonText = ''; + } else if (paidActiveTiers.length > 0 && allOffers.length === 0) { + offerButtonText = 'Add offers'; + offerButtonLink = openAddModal; + } + return ( 0 ? 'Manage offers' : 'Add offer'} link linkWithPadding onClick={allOffers.length > 0 ? openOfferListModal : openAddModal}/>} - description={<>Create discounts & coupons to boost new subscriptions. {allOffers.length === 0 && <>
Learn more}} + customButtons={