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
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import {
BoxFlexDirection,
BoxAlignItems,
BoxJustifyContent,
HeaderStandard,
} from '@metamask/design-system-react-native';
import { useTailwind } from '@metamask/design-system-twrnc-preset';
import HeaderCompactStandard from '../../../../../component-library/components-temp/HeaderCompactStandard';
import UsdcIcon from './usdc.svg';
import { PredictActivityDetailsSelectorsIDs } from '../../Predict.testIds';
interface PredictActivityDetailProps {}
Expand Down Expand Up @@ -413,7 +413,7 @@ const PredictActivityDetails: React.FC<PredictActivityDetailProps> = () => {
testID={PredictActivityDetailsSelectorsIDs.CONTAINER}
>
<Box twClassName="flex-1">
<HeaderCompactStandard
<HeaderStandard
title={
activityDetails?.headerTitle ??
strings('predict.transactions.activity_details')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
TextVariant,
BoxAlignItems,
BoxJustifyContent,
HeaderStandard,
} from '@metamask/design-system-react-native';
import { useTailwind } from '@metamask/design-system-twrnc-preset';
import { InteractionManager, TouchableOpacity } from 'react-native';
Expand All @@ -22,7 +23,6 @@ import { strings } from '../../../../../../locales/i18n';
import BottomSheet from '../../../../../component-library/components/BottomSheets/BottomSheet/BottomSheet';
import { BottomSheetRef } from '../../../../../component-library/components/BottomSheets/BottomSheet/BottomSheet.types';
import BottomSheetFooter from '../../../../../component-library/components/BottomSheets/BottomSheetFooter/BottomSheetFooter';
import HeaderCompactStandard from '../../../../../component-library/components-temp/HeaderCompactStandard';
import { ButtonVariants } from '../../../../../component-library/components/Buttons/Button/Button.types';
import { PREDICT_UNAVAILABLE_TEST_IDS } from './PredictUnavailable.testIds';

Expand Down Expand Up @@ -116,7 +116,7 @@ const PredictUnavailable = forwardRef<
isInteractable
onClose={handleSheetClosed}
>
<HeaderCompactStandard
<HeaderStandard
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Close button may vanish if HeaderStandard lacks onClose

High Severity

The old HeaderCompactStandard explicitly converted its onClose prop into an endButtonIconProps entry with IconName.Close, rendering a visible close button. HeaderStandard from @metamask/design-system-react-native is used elsewhere in the codebase (MoneyHeader, PerpsHomeHeader) but none of those usages pass onClose — they all use endButtonIconProps for end-side actions. If HeaderStandard does not implement the same onClose-to-close-button convenience, this bottom sheet header silently loses its close button, breaking dismiss behavior.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f00630c. Configure here.

testID="header"
title={strings('predict.unavailable.title')}
onClose={handleClose}
Expand Down
7 changes: 2 additions & 5 deletions app/components/UI/Predict/views/PredictFeed/PredictFeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ import {
import { useTailwind } from '@metamask/design-system-twrnc-preset';
import {
Box,
Icon,
IconColor,
HeaderStandard,
IconName,
IconSize,
Text,
TextColor,
TextVariant,
Expand Down Expand Up @@ -84,7 +82,6 @@ import {
TabItem,
TabsBar,
} from '../../../../../component-library/components-temp/Tabs';
import HeaderCompactStandard from '../../../../../component-library/components-temp/HeaderCompactStandard';
import HeaderSearch, {
HeaderSearchVariant,
} from '../../../../../component-library/components-temp/HeaderSearch';
Expand Down Expand Up @@ -729,7 +726,7 @@ const PredictFeed: React.FC<PredictFeedProps> = ({
backgroundColor: colors.background.default,
})}
>
<HeaderCompactStandard
<HeaderStandard
includesTopInset
title={strings('wallet.predict')}
onBack={handleBackPress}
Expand Down
Loading