Skip to content
Open
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
3 changes: 3 additions & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8134,6 +8134,9 @@ const CONST = {
MENU: 'ContextMenu-Menu',
EXPLAIN: 'ContextMenu-Explain',
},
CONFIRM_CONTENT: {
CLOSE_BUTTON: 'ConfirmContent-CloseButton',
},
MORE_MENU: {
MORE_BUTTON: 'MoreMenu-MoreButton',
VIEW_DETAILS: 'MoreMenu-ViewDetails',
Expand Down
3 changes: 2 additions & 1 deletion src/components/ConfirmContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import Button from './Button';
import Header from './Header';
import Icon from './Icon';
import {Close} from './Icon/Expensicons';

Check warning on line 15 in src/components/ConfirmContent.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'./Icon/Expensicons' import is restricted from being used by a pattern. Direct imports from Icon/Expensicons are deprecated. Please use lazy loading hooks instead. Use `useMemoizedLazyExpensifyIcons` from @hooks/useLazyAsset. See docs/LAZY_ICONS_AND_ILLUSTRATIONS.md for details
import ImageSVG from './ImageSVG';
import {PressableWithoutFeedback} from './Pressable';
import Text from './Text';
Expand Down Expand Up @@ -111,7 +111,7 @@
confirmText = '',
cancelText = '',
prompt = '',
success = true,
success = false,
danger = false,
shouldDisableConfirmButtonWhenOffline = false,
shouldShowCancelButton = false,
Expand Down Expand Up @@ -163,6 +163,7 @@
onPress={onCancel}
role={CONST.ROLE.BUTTON}
accessibilityLabel={translate('common.close')}
sentryLabel={CONST.SENTRY_LABEL.CONFIRM_CONTENT.CLOSE_BUTTON}
>
<Icon
fill={theme.icon}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ConfirmModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function ConfirmModal({
confirmText = '',
cancelText = '',
prompt = '',
success = true,
success = false,
danger = false,
Comment on lines 121 to 125

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep default success styling for multi-button modals

Changing the default success prop to false means any ConfirmModal/ConfirmContent caller that relies on the default (common in showConfirmModal flows) will now render a neutral/grey confirm button even when a cancel button is shown. That removes the primary emphasis between confirm vs. cancel and makes both actions look equivalent, which is a UX regression for two-button confirmations. If the intent is only to gray out one-button modals, the default should remain success or be conditional on shouldShowCancelButton rather than globally flipping the default.

Useful? React with 👍 / 👎.

onCancel = () => {},
onBackdropPress,
Expand Down
Loading