Commit dcaa40a
refactor(predict): use MMDS HeaderStandard (#29704)
## **Description**
This PR replaces the temporary `HeaderCompactStandard` component with
`HeaderStandard` from `@metamask/design-system-react-native` on Predict
screens and sheets.
**Reason:** Align Predict UI with the MetaMask design system and rely
less on `component-library/components-temp` for standard headers.
**What changed:**
- **Predict feed:** Main Predict feed header now uses `HeaderStandard`
with `includesTopInset`, back handling, and the existing title string.
Unused design-system imports (`Icon`, `IconColor`, `IconSize`) were
removed from this file after the swap.
- **Activity detail:** Activity detail screen header uses
`HeaderStandard` with the same title fallback logic
(`activityDetails?.headerTitle` vs. the default activity-details
string).
- **Unavailable bottom sheet:** The “Predict unavailable” sheet header
uses `HeaderStandard` with `testID`, title, and close behavior
unchanged.
Behavior is intended to match the previous headers (navigation, titles,
safe area).
## **Changelog**
CHANGELOG entry: null
## **Related issues**
Fixes: https://consensyssoftware.atlassian.net/browse/DSYS-701
## **Manual testing steps**
```gherkin
Feature: Predict headers use design system HeaderStandard
Scenario: Predict feed header
Given the user opens Predict from the wallet (Predict feed)
When they view the header title and tap back
Then navigation matches prior behavior and the title shows the expected Predict label
Scenario: Activity detail header
Given the user opens a Predict activity from history or the feed
When they view activity details
Then the header title reflects activity-specific copy when present or the default activity-details string
When they use the back control
Then they return to the previous screen as before
Scenario: Predict unavailable sheet
Given Predict is unavailable and the bottom sheet is shown
When the user views the header and closes the sheet
Then the sheet dismisses as before
```
## **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 a temporary header component for the
design-system `HeaderStandard`; primary risk is minor layout/safe-area
or button behavior differences across screens/sheets.
>
> **Overview**
> Updates Predict UI to use the design-system `HeaderStandard` in place
of the temporary `HeaderCompactStandard` on the feed screen, activity
detail screen, and the “Predict unavailable” bottom sheet.
>
> Keeps existing titles and back/close wiring (including testIDs and
`includesTopInset`) while removing now-unused icon-related imports in
`PredictFeed`.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
391f93a. 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 229b997 commit dcaa40a
3 files changed
Lines changed: 6 additions & 9 deletions
File tree
- app/components/UI/Predict
- components
- PredictActivityDetail
- views/PredictFeed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | | - | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
413 | 413 | | |
414 | 414 | | |
415 | 415 | | |
416 | | - | |
| 416 | + | |
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | | - | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| |||
Lines changed: 2 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
| 23 | + | |
25 | 24 | | |
26 | | - | |
27 | 25 | | |
28 | 26 | | |
29 | 27 | | |
| |||
84 | 82 | | |
85 | 83 | | |
86 | 84 | | |
87 | | - | |
88 | 85 | | |
89 | 86 | | |
90 | 87 | | |
| |||
726 | 723 | | |
727 | 724 | | |
728 | 725 | | |
729 | | - | |
| 726 | + | |
730 | 727 | | |
731 | 728 | | |
732 | 729 | | |
| |||
0 commit comments