Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -3,10 +3,10 @@ import { useNavigation } from '@react-navigation/native';
import {
HeaderSearch,
HeaderSearchVariant,
HeaderStandard,
IconName as DSIconName,
} from '@metamask/design-system-react-native';
import { strings } from '../../../../../../locales/i18n';
import HeaderCompactStandard from '../../../../../component-library/components-temp/HeaderCompactStandard';
import type { TrendingListHeaderProps } from './TrendingListHeader.types';

/**
Expand Down Expand Up @@ -98,7 +98,7 @@ const TrendingListHeader: React.FC<TrendingListHeaderProps> = ({
}

return (
<HeaderCompactStandard
<HeaderStandard
title={title || strings('trending.trending_tokens')}
onBack={handleBack}
backButtonProps={{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { useRef, useState, useCallback, useEffect } from 'react';
import { HeaderStandard } from '@metamask/design-system-react-native';
import { StyleSheet, ScrollView } from 'react-native';
import BottomSheet, {
BottomSheetRef,
} from '../../../../../component-library/components/BottomSheets/BottomSheet';
import HeaderCompactStandard from '../../../../../component-library/components-temp/HeaderCompactStandard';
import Icon, {
IconName,
IconSize,
Expand Down Expand Up @@ -115,7 +115,7 @@ const TrendingTokenNetworkBottomSheet: React.FC<
onClose={handleSheetClose}
testID="trending-token-network-bottom-sheet"
>
<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 silently disappear in bottom sheets

High Severity

The old HeaderCompactStandard explicitly converted onClose/closeButtonProps into a close ButtonIcon added to endButtonIconProps. Every existing usage of HeaderStandard in the codebase (MoneyHeader, PerpsHomeHeader) uses only onBack/backButtonProps/endButtonIconProps — none pass onClose or closeButtonProps. If HeaderStandard doesn't implement the same convenience-prop-to-button transformation, the close button in all three bottom sheets silently vanishes without any error.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3bfd0f2. Configure here.

title={strings('trending.networks')}
onClose={handleClose}
closeButtonProps={{ testID: 'close-button' }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useRef, useState, useCallback, useEffect } from 'react';
import { HeaderStandard } from '@metamask/design-system-react-native';
import { View, StyleSheet, TouchableOpacity, Platform } from 'react-native';
import { useTheme } from '../../../../../util/theme';
import BottomSheet, {
Expand All @@ -14,7 +15,6 @@ import Icon, {
IconColor,
} from '../../../../../component-library/components/Icons/Icon';
import { strings } from '../../../../../../locales/i18n';
import HeaderCompactStandard from '../../../../../component-library/components-temp/HeaderCompactStandard';
import Button, {
ButtonVariants,
ButtonWidthTypes,
Expand Down Expand Up @@ -149,7 +149,7 @@ const TrendingTokenPriceChangeBottomSheet: React.FC<
onClose={handleSheetClose}
testID="trending-token-price-change-bottom-sheet"
>
<HeaderCompactStandard
<HeaderStandard
title={strings('trending.sort_by')}
onClose={handleClose}
closeButtonProps={{ testID: 'close-button' }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useRef, useState, useCallback, useEffect } from 'react';
import { HeaderStandard } from '@metamask/design-system-react-native';
import { View, StyleSheet, TouchableOpacity } from 'react-native';
import { useTheme } from '../../../../../util/theme';
import BottomSheet, {
Expand All @@ -7,7 +8,6 @@ import BottomSheet, {
import Text, {
TextVariant,
} from '../../../../../component-library/components/Texts/Text';
import HeaderCompactStandard from '../../../../../component-library/components-temp/HeaderCompactStandard';
import Icon, {
IconName,
IconSize,
Expand Down Expand Up @@ -139,7 +139,7 @@ const TrendingTokenTimeBottomSheet: React.FC<
onClose={handleSheetClose}
testID="trending-token-time-bottom-sheet"
>
<HeaderCompactStandard
<HeaderStandard
title={strings('trending.time')}
onClose={handleClose}
closeButtonProps={{ testID: 'close-button' }}
Expand Down
Loading