0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

chore: fix add on notice footer

This commit is contained in:
Darcy Ye 2024-08-16 00:54:16 +08:00
parent e9e5b057e8
commit c0ca5b427c
No known key found for this signature in database
GPG key ID: B46F4C07EDEFC610
2 changed files with 12 additions and 6 deletions

View file

@ -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 (
<div className={styles.container}>
<div className={styles.description}>{children}</div>
@ -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}
/>
</div>

View file

@ -165,10 +165,10 @@ function SsoCreationModal({ isOpen, onClose: rawOnClose }: Props) {
!enterpriseSsoUpsellNoticeAcknowledged && (
<AddOnNoticeFooter
buttonTitle="enterprise_sso.create_modal.create_button_text"
isButtonDisabled={isCreateButtonDisabled}
onClick={() => {
isCreateButtonDisabled={isCreateButtonDisabled}
onClick={async () => {
void update({ enterpriseSsoUpsellNoticeAcknowledged: true });
void onSubmit();
await onSubmit();
}}
>
<Trans