From 5a4d98e90dad75c77fd01157faf36842bec36b02 Mon Sep 17 00:00:00 2001 From: Princi Vershwal Date: Wed, 6 Dec 2023 10:01:48 +0530 Subject: [PATCH] Show Add offer button on settings screen if no offer is present (#19215) Ref [PROD-3](https://linear.app/tryghost/issue/PROD-3/settings-group-navigation-handling) --- .../src/components/settings/growth/Offers.tsx | 8 +++++-- .../test/acceptance/membership/offers.test.ts | 23 +++++++++++-------- 2 files changed, 19 insertions(+), 12 deletions(-) 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 10d1ebeaa0..25ac87063c 100644 --- a/apps/admin-x-settings/src/components/settings/growth/Offers.tsx +++ b/apps/admin-x-settings/src/components/settings/growth/Offers.tsx @@ -48,17 +48,21 @@ const Offers: React.FC<{ keywords: string[] }> = ({keywords}) => { const latestThree = activeOffers.slice(0, 3); - const openModal = () => { + const openOfferListModal = () => { updateRoute('offers/edit'); }; + const openAddModal = () => { + updateRoute('offers/new'); + }; + const goToOfferEdit = (offerId: string) => { updateRoute(`offers/edit/${offerId}`); }; return ( } + customButtons={