Skip to content

Commit

Permalink
fix(console): leave page button should be primary on unsaved changes …
Browse files Browse the repository at this point in the history
…alert modal (#1421)
  • Loading branch information
xiaoyijun authored Jul 5, 2022
1 parent 1d5f69d commit be004fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
4 changes: 1 addition & 3 deletions packages/console/src/components/ConfirmModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export type ConfirmModalProps = {
isOpen: boolean;
onCancel: () => void;
onConfirm: () => void;
onClose?: () => void;
};

const ConfirmModal = ({
Expand All @@ -32,7 +31,6 @@ const ConfirmModal = ({
isOpen,
onCancel,
onConfirm,
onClose = onCancel,
}: ConfirmModalProps) => {
return (
<ReactModal
Expand All @@ -49,7 +47,7 @@ const ConfirmModal = ({
</>
}
className={classNames(styles.content, className)}
onClose={onClose}
onClose={onCancel}
>
{children}
</ModalLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit be004fa

Please sign in to comment.