Commit e4b335f
authored
fix(homepage): revert ErrorState icon to design system and center Retry button (#26643)
## **Description**
Fixes two issues in the `ErrorState` component used by Homepage
sections:
1. **Reverts icon to design system**: Replaces the custom PNG image
(`wifi-off.png`) with the design system `Icon` component
(`IconName.WifiOff`), restoring consistency with the design system
approach.
2. **Centers the Retry button**: Adds `self-center` to the Button so it
is horizontally centered within the error state, matching the centered
icon and text above it.
**Changes:**
- Replace `Image` + `wifi-off.png` with `Icon` from
`@metamask/design-system-react-native`
- Remove `ErrorState.styles` import (no longer needed)
- Delete unused `app/images/wifi-off.png` asset
- Add `twClassName="self-center"` to the Retry button
## **Changelog**
CHANGELOG entry: null
## **Related issues**
Refs: https://consensyssoftware.atlassian.net/browse/TMCU-407
## **Manual testing steps**
```gherkin
Feature: ErrorState component fixes
Scenario: error state shows centered wifi-off icon from design system
Given a homepage section fails to load
When the error state is displayed
Then the wifi-off icon is rendered using the design system Icon component
And the Retry button is horizontally centered below the error message
```
## **Screenshots/Recordings**
### **Before**
<img width="300"
src="https://github.com/user-attachments/assets/b71ad654-ff73-440c-a84e-09a4d34ac730"
/>
<img width="300"
src="https://github.com/user-attachments/assets/82f28853-08db-4543-983a-e3a842af2c59"
/>
### **After**
<img width="300"
src="https://github.com/user-attachments/assets/bcc8480c-c1d5-4efc-bfa2-81aba1dc6ce2"
/>
<img width="300"
src="https://github.com/user-attachments/assets/4353c7dd-9194-4b09-9e37-0f30d6b12d2b"
/>
<!-- Design system icon, button centered -->
## **Pre-merge author checklist**
- [x] I have 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 have completed the PR template to the best of my ability
- [x] I have included tests if applicable
- [x] I have documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I have 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.
## **Pre-merge reviewer checklist**
- [ ] I have 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-only change that swaps a local PNG/styled `Image` for a
design-system `Icon` and tweaks button alignment; no business logic or
data handling changes.
>
> **Overview**
> Updates the Homepage `ErrorState` UI to use the design system `Icon`
(`IconName.WifiOff`, muted XL) instead of a bundled `wifi-off.png` +
`StyleSheet` styles, and removes the now-unused `ErrorState.styles.ts`.
>
> Centers the Retry button by adding `twClassName="self-center"`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
8fe53f4. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 5ea5349 commit e4b335f
3 files changed
Lines changed: 10 additions & 11 deletions
File tree
- app
- components/Views/Homepage/components/ErrorState
- images
Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
6 | 9 | | |
7 | 10 | | |
8 | 11 | | |
| |||
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
14 | | - | |
15 | | - | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
45 | 50 | | |
46 | 51 | | |
47 | 52 | | |
| |||
53 | 58 | | |
54 | 59 | | |
55 | 60 | | |
| 61 | + | |
56 | 62 | | |
57 | 63 | | |
58 | 64 | | |
| |||
Binary file not shown.
0 commit comments