Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/components/ConfirmModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ type ConfirmModalProps = {

/** Whether the confirm button is loading */
isConfirmLoading?: boolean;

/** Whether to handle navigation back when modal show. */
shouldHandleNavigationBack?: boolean;
};

function ConfirmModal({
Expand Down Expand Up @@ -143,6 +146,7 @@ function ConfirmModal({
shouldEnableNewFocusManagement,
restoreFocusType,
isConfirmLoading,
shouldHandleNavigationBack,
}: ConfirmModalProps) {
// We need to use isSmallScreenWidth instead of shouldUseNarrowLayout to use the correct modal type
// eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth
Expand All @@ -160,6 +164,7 @@ function ConfirmModal({
innerContainerStyle={image ? styles.pt0 : {}}
shouldEnableNewFocusManagement={shouldEnableNewFocusManagement}
restoreFocusType={restoreFocusType}
shouldHandleNavigationBack={shouldHandleNavigationBack}
>
<ConfirmContent
title={title}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ function DiscardChangesConfirmation({getHasUnsavedChanges}: DiscardChangesConfir
}
}}
onCancel={() => setIsVisible(false)}
shouldHandleNavigationBack
/>
);
}
Expand Down