0
Fork 0
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:
Xiao Yijun 2022-07-05 18:26:39 +08:00 committed by GitHub
parent 1d5f69db12
commit be004fa4da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 9 deletions

View file

@ -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>

View file

@ -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>