mirror of
https://github.com/logto-io/logto.git
synced 2025-01-27 21:39:16 -05:00
fix(console): leave page button should be primary on unsaved changes alert modal (#1421)
This commit is contained in:
parent
1d5f69db12
commit
be004fa4da
2 changed files with 5 additions and 9 deletions
|
@ -19,7 +19,6 @@ export type ConfirmModalProps = {
|
|||
isOpen: boolean;
|
||||
onCancel: () => void;
|
||||
onConfirm: () => void;
|
||||
onClose?: () => void;
|
||||
};
|
||||
|
||||
const ConfirmModal = ({
|
||||
|
@ -32,7 +31,6 @@ const ConfirmModal = ({
|
|||
isOpen,
|
||||
onCancel,
|
||||
onConfirm,
|
||||
onClose = onCancel,
|
||||
}: ConfirmModalProps) => {
|
||||
return (
|
||||
<ReactModal
|
||||
|
@ -49,7 +47,7 @@ const ConfirmModal = ({
|
|||
</>
|
||||
}
|
||||
className={classNames(styles.content, className)}
|
||||
onClose={onClose}
|
||||
onClose={onCancel}
|
||||
>
|
||||
{children}
|
||||
</ModalLayout>
|
||||
|
|
|
@ -68,12 +68,10 @@ const UnsavedChangesAlertModal = ({ hasUnsavedChanges }: Props) => {
|
|||
return (
|
||||
<ConfirmModal
|
||||
isOpen={displayAlert}
|
||||
confirmButtonType="primary"
|
||||
confirmButtonText="admin_console.general.stay_on_page"
|
||||
cancelButtonText="admin_console.general.leave_page"
|
||||
onCancel={leavePage}
|
||||
onConfirm={stayOnPage}
|
||||
onClose={stayOnPage}
|
||||
confirmButtonText="admin_console.general.leave_page"
|
||||
cancelButtonText="admin_console.general.stay_on_page"
|
||||
onCancel={stayOnPage}
|
||||
onConfirm={leavePage}
|
||||
>
|
||||
{t('general.unsaved_changes_warning')}
|
||||
</ConfirmModal>
|
||||
|
|
Loading…
Add table
Reference in a new issue