mirror of
https://github.com/logto-io/logto.git
synced 2025-03-10 22:22:45 -05:00
refactor(console): hide cancel button for not eligible switch plan modal (#4222)
This commit is contained in:
parent
6289b9f820
commit
48fc9512cd
3 changed files with 7 additions and 1 deletions
|
@ -22,6 +22,7 @@ export type ConfirmModalProps = {
|
|||
isOpen: boolean;
|
||||
isConfirmButtonDisabled?: boolean;
|
||||
isLoading?: boolean;
|
||||
isCancelButtonVisible?: boolean;
|
||||
size?: ModalLayoutProps['size'];
|
||||
onCancel?: () => void;
|
||||
onConfirm?: () => void;
|
||||
|
@ -37,6 +38,7 @@ function ConfirmModal({
|
|||
isOpen,
|
||||
isConfirmButtonDisabled = false,
|
||||
isLoading = false,
|
||||
isCancelButtonVisible = true,
|
||||
size,
|
||||
onCancel,
|
||||
onConfirm,
|
||||
|
@ -53,7 +55,9 @@ function ConfirmModal({
|
|||
title={title}
|
||||
footer={
|
||||
<>
|
||||
{onCancel && <Button title={cancelButtonText} onClick={onCancel} />}
|
||||
{isCancelButtonVisible && onCancel && (
|
||||
<Button title={cancelButtonText} onClick={onCancel} />
|
||||
)}
|
||||
{onConfirm && (
|
||||
<Button
|
||||
type={confirmButtonType}
|
||||
|
|
|
@ -60,6 +60,7 @@ function MauLimitExceededNotification({ activeUsers, currentPlan, className }: P
|
|||
title: 'subscription.not_eligible_modal.upgrade_title',
|
||||
confirmButtonText: 'general.got_it',
|
||||
confirmButtonType: 'primary',
|
||||
isCancelButtonVisible: false,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -87,6 +87,7 @@ function SwitchPlanActionBar({
|
|||
: 'subscription.not_eligible_modal.upgrade_title',
|
||||
confirmButtonText: 'general.got_it',
|
||||
confirmButtonType: 'primary',
|
||||
isCancelButtonVisible: false,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue