Skip to content

Commit 229b997

Browse files
refactor(trending): use MMDS HeaderStandard (#29707)
## **Description** This PR replaces `HeaderCompactStandard` with `HeaderStandard` from `@metamask/design-system-react-native` on Trending UI. **Reason:** Align Trending with the MetaMask design system and avoid `component-library/components-temp` for standard headers. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/DSYS-704 ## **Manual testing steps** ```gherkin Feature: Trending uses design system HeaderStandard Scenario: Trending list header Given the user opens Trending tokens When they view the header title and use back or search as before Then navigation and search behavior match prior behavior Scenario: Network, sort, and time bottom sheets Given the user opens the network selector, price-change sort, or time-range sheet from Trending When they view each sheet title and tap close Then each sheet dismisses and labels match prior copy ``` ## **Screenshots/Recordings** ### **Before** ### **After** ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. #### Performance checks (if applicable) - [ ] I've tested on Android - Ideally on a mid-range device; emulator is acceptable - [ ] I've tested with a power user scenario - Use these [power-user SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93) to import wallets with many accounts and tokens - [ ] I've instrumented key operations with Sentry traces for production performance metrics - See [`trace()`](/app/util/trace.ts) for usage and [`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274) for an example For performance guidelines and tooling, see the [Performance Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers). ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk UI refactor that swaps header components; main risk is minor regressions in header/back/close/testID wiring across Trending screens and related tests. > > **Overview** > Updates Trending UI to use the design-system `HeaderStandard` instead of the temporary `HeaderCompactStandard`, covering the main Trending list header and the network/price-change/time bottom-sheet headers. > > Adjusts a Rewards `OndoCampaignRwaSelectorView` test to press the new back-button testID emitted by the updated header implementation. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 030a1cd. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 89911ca commit 229b997

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

app/components/UI/Trending/components/TrendingListHeader/TrendingListHeader.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import { useNavigation } from '@react-navigation/native';
33
import {
44
HeaderSearch,
55
HeaderSearchVariant,
6+
HeaderStandard,
67
IconName as DSIconName,
78
} from '@metamask/design-system-react-native';
89
import { strings } from '../../../../../../locales/i18n';
9-
import HeaderCompactStandard from '../../../../../component-library/components-temp/HeaderCompactStandard';
1010
import type { TrendingListHeaderProps } from './TrendingListHeader.types';
1111

1212
/**
@@ -98,7 +98,7 @@ const TrendingListHeader: React.FC<TrendingListHeaderProps> = ({
9898
}
9999

100100
return (
101-
<HeaderCompactStandard
101+
<HeaderStandard
102102
title={title || strings('trending.trending_tokens')}
103103
onBack={handleBack}
104104
backButtonProps={{

app/components/UI/Trending/components/TrendingTokensBottomSheet/TrendingTokenNetworkBottomSheet.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import React, { useRef, useState, useCallback, useEffect } from 'react';
2+
import { HeaderStandard } from '@metamask/design-system-react-native';
23
import { StyleSheet, ScrollView } from 'react-native';
34
import BottomSheet, {
45
BottomSheetRef,
56
} from '../../../../../component-library/components/BottomSheets/BottomSheet';
6-
import HeaderCompactStandard from '../../../../../component-library/components-temp/HeaderCompactStandard';
77
import Icon, {
88
IconName,
99
IconSize,
@@ -115,7 +115,7 @@ const TrendingTokenNetworkBottomSheet: React.FC<
115115
onClose={handleSheetClose}
116116
testID="trending-token-network-bottom-sheet"
117117
>
118-
<HeaderCompactStandard
118+
<HeaderStandard
119119
title={strings('trending.networks')}
120120
onClose={handleClose}
121121
closeButtonProps={{ testID: 'close-button' }}

app/components/UI/Trending/components/TrendingTokensBottomSheet/TrendingTokenPriceChangeBottomSheet.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, { useRef, useState, useCallback, useEffect } from 'react';
2+
import { HeaderStandard } from '@metamask/design-system-react-native';
23
import { View, StyleSheet, TouchableOpacity, Platform } from 'react-native';
34
import { useTheme } from '../../../../../util/theme';
45
import BottomSheet, {
@@ -14,7 +15,6 @@ import Icon, {
1415
IconColor,
1516
} from '../../../../../component-library/components/Icons/Icon';
1617
import { strings } from '../../../../../../locales/i18n';
17-
import HeaderCompactStandard from '../../../../../component-library/components-temp/HeaderCompactStandard';
1818
import Button, {
1919
ButtonVariants,
2020
ButtonWidthTypes,
@@ -149,7 +149,7 @@ const TrendingTokenPriceChangeBottomSheet: React.FC<
149149
onClose={handleSheetClose}
150150
testID="trending-token-price-change-bottom-sheet"
151151
>
152-
<HeaderCompactStandard
152+
<HeaderStandard
153153
title={strings('trending.sort_by')}
154154
onClose={handleClose}
155155
closeButtonProps={{ testID: 'close-button' }}

app/components/UI/Trending/components/TrendingTokensBottomSheet/TrendingTokenTimeBottomSheet.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, { useRef, useState, useCallback, useEffect } from 'react';
2+
import { HeaderStandard } from '@metamask/design-system-react-native';
23
import { View, StyleSheet, TouchableOpacity } from 'react-native';
34
import { useTheme } from '../../../../../util/theme';
45
import BottomSheet, {
@@ -7,7 +8,6 @@ import BottomSheet, {
78
import Text, {
89
TextVariant,
910
} from '../../../../../component-library/components/Texts/Text';
10-
import HeaderCompactStandard from '../../../../../component-library/components-temp/HeaderCompactStandard';
1111
import Icon, {
1212
IconName,
1313
IconSize,
@@ -139,7 +139,7 @@ const TrendingTokenTimeBottomSheet: React.FC<
139139
onClose={handleSheetClose}
140140
testID="trending-token-time-bottom-sheet"
141141
>
142-
<HeaderCompactStandard
142+
<HeaderStandard
143143
title={strings('trending.time')}
144144
onClose={handleClose}
145145
closeButtonProps={{ testID: 'close-button' }}

0 commit comments

Comments
 (0)