From c0ca5b427cb0b0ee3b6668d34b039e82bd8dd437 Mon Sep 17 00:00:00 2001 From: Darcy Ye Date: Fri, 16 Aug 2024 00:54:16 +0800 Subject: [PATCH] chore: fix add on notice footer --- .../src/components/AddOnNoticeFooter/index.tsx | 12 +++++++++--- .../pages/EnterpriseSso/SsoCreationModal/index.tsx | 6 +++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/console/src/components/AddOnNoticeFooter/index.tsx b/packages/console/src/components/AddOnNoticeFooter/index.tsx index 74b9ece28..af2cfead1 100644 --- a/packages/console/src/components/AddOnNoticeFooter/index.tsx +++ b/packages/console/src/components/AddOnNoticeFooter/index.tsx @@ -9,11 +9,17 @@ type Props = { readonly children: ReactNode; readonly isLoading?: boolean; readonly buttonTitle?: AdminConsoleKey; - readonly isButtonDisabled?: boolean; + readonly isCreateButtonDisabled?: boolean; readonly onClick: () => void; }; -function AddOnNoticeFooter({ children, isLoading, onClick, isButtonDisabled, buttonTitle }: Props) { +function AddOnNoticeFooter({ + children, + isLoading, + onClick, + isCreateButtonDisabled, + buttonTitle, +}: Props) { return (
{children}
@@ -22,7 +28,7 @@ function AddOnNoticeFooter({ children, isLoading, onClick, isButtonDisabled, but type="primary" title={buttonTitle ?? 'upsell.upgrade_plan'} isLoading={isLoading} - disabled={isButtonDisabled} + disabled={isCreateButtonDisabled} onClick={onClick} />
diff --git a/packages/console/src/pages/EnterpriseSso/SsoCreationModal/index.tsx b/packages/console/src/pages/EnterpriseSso/SsoCreationModal/index.tsx index 5fbf9bf5e..723f24dc7 100644 --- a/packages/console/src/pages/EnterpriseSso/SsoCreationModal/index.tsx +++ b/packages/console/src/pages/EnterpriseSso/SsoCreationModal/index.tsx @@ -165,10 +165,10 @@ function SsoCreationModal({ isOpen, onClose: rawOnClose }: Props) { !enterpriseSsoUpsellNoticeAcknowledged && ( { + isCreateButtonDisabled={isCreateButtonDisabled} + onClick={async () => { void update({ enterpriseSsoUpsellNoticeAcknowledged: true }); - void onSubmit(); + await onSubmit(); }} >