mirror of
https://github.com/logto-io/logto.git
synced 2025-02-03 21:48:55 -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;
|
isOpen: boolean;
|
||||||
onCancel: () => void;
|
onCancel: () => void;
|
||||||
onConfirm: () => void;
|
onConfirm: () => void;
|
||||||
onClose?: () => void;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const ConfirmModal = ({
|
const ConfirmModal = ({
|
||||||
|
@ -32,7 +31,6 @@ const ConfirmModal = ({
|
||||||
isOpen,
|
isOpen,
|
||||||
onCancel,
|
onCancel,
|
||||||
onConfirm,
|
onConfirm,
|
||||||
onClose = onCancel,
|
|
||||||
}: ConfirmModalProps) => {
|
}: ConfirmModalProps) => {
|
||||||
return (
|
return (
|
||||||
<ReactModal
|
<ReactModal
|
||||||
|
@ -49,7 +47,7 @@ const ConfirmModal = ({
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
className={classNames(styles.content, className)}
|
className={classNames(styles.content, className)}
|
||||||
onClose={onClose}
|
onClose={onCancel}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</ModalLayout>
|
</ModalLayout>
|
||||||
|
|
|
@ -68,12 +68,10 @@ const UnsavedChangesAlertModal = ({ hasUnsavedChanges }: Props) => {
|
||||||
return (
|
return (
|
||||||
<ConfirmModal
|
<ConfirmModal
|
||||||
isOpen={displayAlert}
|
isOpen={displayAlert}
|
||||||
confirmButtonType="primary"
|
confirmButtonText="admin_console.general.leave_page"
|
||||||
confirmButtonText="admin_console.general.stay_on_page"
|
cancelButtonText="admin_console.general.stay_on_page"
|
||||||
cancelButtonText="admin_console.general.leave_page"
|
onCancel={stayOnPage}
|
||||||
onCancel={leavePage}
|
onConfirm={leavePage}
|
||||||
onConfirm={stayOnPage}
|
|
||||||
onClose={stayOnPage}
|
|
||||||
>
|
>
|
||||||
{t('general.unsaved_changes_warning')}
|
{t('general.unsaved_changes_warning')}
|
||||||
</ConfirmModal>
|
</ConfirmModal>
|
||||||
|
|
Loading…
Add table
Reference in a new issue