Commit 428bdda
refactor(earn): use MMDS HeaderStandard (#29702)
## **Description**
This change replaces the temporary `HeaderCompactStandard` component
with `HeaderStandard` from `@metamask/design-system-react-native` on
Earn-related surfaces.
**Reason:** Align Earn UI with the MetaMask design system and reduce
reliance on `component-library/components-temp` for standard headers.
**What changed:** `HeaderStandard` is used for the Lending “How it
works” bottom sheet, the Earn input screen header (back button and end
actions), and the Earn token list bottom sheet. Behavior is intended to
match the previous header (title, back/close, analytics-related tests
unchanged aside from naming). Unit test comments and a `describe` block
name were updated to reference `HeaderStandard`.
## **Changelog**
CHANGELOG entry: null
## **Related issues**
Fixes: https://consensyssoftware.atlassian.net/browse/DSYS-699
## **Manual testing steps**
```gherkin
Feature: Earn headers use design system HeaderStandard
Scenario: Earn input screen header matches prior behavior
Given the user is on the Earn flow and opens the amount/input screen (e.g. stake or supply)
When the user views the screen header and uses the back control
Then the header shows the expected title and navigation behaves as before
Scenario: Lending “How it works” modal
Given the user opens the Lending learn-more / “How it works” bottom sheet from Earn
When the user views the header and taps close
Then the sheet dismisses as before
Scenario: Earn token selection bottom sheet
Given the user opens the token list bottom sheet (e.g. select token to supply or withdraw)
When the user views the header title and uses the close control
Then the sheet closes as before and titles match the prior copy for the flow
```
## **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 refactor that swaps a temporary header component for the
design-system header on a few Earn screens; main regression risk is
minor UI/interaction differences in back/close and end-icon rendering.
>
> **Overview**
> Updates Earn surfaces to use the design-system `HeaderStandard`
instead of the temporary `HeaderCompactStandard`, including the Lending
“How it works” bottom sheet, the `EarnInputView` screen header (back +
optional info icon), and the Earn token list bottom sheet (close button
+ title).
>
> Adjusts imports accordingly (including `IconName` usage from the
design system) and updates unit test descriptions/comments to reference
`HeaderStandard` while keeping behavioral assertions the same.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
c517a2e. 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 1de00bb commit 428bdda
5 files changed
Lines changed: 10 additions & 11 deletions
File tree
- app/components/UI/Earn
- LendingLearnMoreModal
- Views/EarnInputView
- components/EarnTokenList
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | | - | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
291 | | - | |
| 291 | + | |
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
527 | 527 | | |
528 | 528 | | |
529 | 529 | | |
530 | | - | |
| 530 | + | |
531 | 531 | | |
532 | 532 | | |
533 | 533 | | |
| |||
1202 | 1202 | | |
1203 | 1203 | | |
1204 | 1204 | | |
1205 | | - | |
| 1205 | + | |
1206 | 1206 | | |
1207 | 1207 | | |
1208 | 1208 | | |
| |||
1845 | 1845 | | |
1846 | 1846 | | |
1847 | 1847 | | |
1848 | | - | |
| 1848 | + | |
1849 | 1849 | | |
1850 | 1850 | | |
1851 | 1851 | | |
| |||
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | | - | |
| 48 | + | |
50 | 49 | | |
51 | 50 | | |
52 | 51 | | |
| |||
1005 | 1004 | | |
1006 | 1005 | | |
1007 | 1006 | | |
1008 | | - | |
| 1007 | + | |
1009 | 1008 | | |
1010 | 1009 | | |
1011 | 1010 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
947 | 947 | | |
948 | 948 | | |
949 | 949 | | |
950 | | - | |
| 950 | + | |
951 | 951 | | |
952 | 952 | | |
953 | 953 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | | - | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
383 | | - | |
| 383 | + | |
384 | 384 | | |
385 | 385 | | |
386 | 386 | | |
| |||
0 commit comments