From 3611e99422b605ed7b84308d466382464198d8c2 Mon Sep 17 00:00:00 2001 From: Sodbileg Gansukh Date: Thu, 4 Jan 2024 09:17:53 +0700 Subject: [PATCH] Close offer modal after archiving/reactivating (#19437) fixes PROD-284 --- .../src/components/settings/growth/offers/EditOfferModal.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/admin-x-settings/src/components/settings/growth/offers/EditOfferModal.tsx b/apps/admin-x-settings/src/components/settings/growth/offers/EditOfferModal.tsx index 12bb347ca4..2efbaad5b3 100644 --- a/apps/admin-x-settings/src/components/settings/growth/offers/EditOfferModal.tsx +++ b/apps/admin-x-settings/src/components/settings/growth/offers/EditOfferModal.tsx @@ -34,6 +34,8 @@ const Sidebar: React.FC<{ const [nameLength, setNameLength] = useState(offer?.name.length || 0); const nameLengthColor = nameLength > 40 ? 'text-red' : 'text-green'; + const {updateRoute} = useRouting(); + useEffect(() => { if (offer?.name) { setNameLength(offer?.name.length); @@ -66,6 +68,7 @@ const Sidebar: React.FC<{ type: 'success', message: 'Offer archived successfully' }); + updateRoute('offers/edit'); } catch (e) { handleError(e); } @@ -86,6 +89,7 @@ const Sidebar: React.FC<{ type: 'success', message: 'Offer reactivated successfully' }); + updateRoute('offers/edit'); } catch (e) { handleError(e); }