From 79081686b1fdfb5e4aaef8f198191576cded8777 Mon Sep 17 00:00:00 2001 From: Sodbileg Gansukh Date: Thu, 30 Nov 2023 16:56:29 +0800 Subject: [PATCH] Disabled backdrop click for offers modals (#19194) refs ADM-37 - backdrop click should be disabled for modals, especially when modals contain user editable fields - to make things consistent, all offers related modals are not closeable by backdrop clicking --- apps/admin-x-design-system/src/global/modal/PreviewModal.tsx | 3 +++ .../src/components/settings/growth/offers/AddOfferModal.tsx | 1 + .../src/components/settings/growth/offers/EditOfferModal.tsx | 1 + .../src/components/settings/growth/offers/OfferSuccess.tsx | 1 + .../src/components/settings/growth/offers/OffersIndex.tsx | 1 + 5 files changed, 7 insertions(+) diff --git a/apps/admin-x-design-system/src/global/modal/PreviewModal.tsx b/apps/admin-x-design-system/src/global/modal/PreviewModal.tsx index f1fa63d411..f4ec405e88 100644 --- a/apps/admin-x-design-system/src/global/modal/PreviewModal.tsx +++ b/apps/admin-x-design-system/src/global/modal/PreviewModal.tsx @@ -44,6 +44,7 @@ export interface PreviewModalProps { sidebarPadding?: boolean; sidebarContentClasses?: string; enableCMDS?: boolean; + backDropClick?: boolean; onCancel?: () => void; onOk?: () => void; @@ -83,6 +84,7 @@ export const PreviewModalContent: React.FC = ({ sidebarPadding = true, sidebarContentClasses, enableCMDS = true, + backDropClick, onCancel, onOk, @@ -262,6 +264,7 @@ export const PreviewModalContent: React.FC = ({ { afterClose={() => { updateRoute('offers'); }} + backDropClick={false} cancelLabel='Cancel' deviceSelector={false} dirty={saveState === 'unsaved'} 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 e94f88fdc5..32a6857776 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 @@ -256,6 +256,7 @@ const EditOfferModal: React.FC<{id: string}> = ({id}) => { afterClose={() => { updateRoute('offers'); }} + backDropClick={false} deviceSelector={false} dirty={saveState === 'unsaved'} height='full' diff --git a/apps/admin-x-settings/src/components/settings/growth/offers/OfferSuccess.tsx b/apps/admin-x-settings/src/components/settings/growth/offers/OfferSuccess.tsx index 88f0f52103..2e5ef4a417 100644 --- a/apps/admin-x-settings/src/components/settings/growth/offers/OfferSuccess.tsx +++ b/apps/admin-x-settings/src/components/settings/growth/offers/OfferSuccess.tsx @@ -74,6 +74,7 @@ const OfferSuccess: React.FC<{id: string}> = ({id}) => { updateRoute('offers'); }} animate={false} + backDropClick={false} footer={false} height='full' size='lg' 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 b257613148..344f57357b 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 @@ -194,6 +194,7 @@ export const OffersIndexModal = () => { updateRoute('offers'); }} animate={false} + backDropClick={false} cancelLabel='' header={false} height='full'