Commit 3d1f94d
authored
feat(homepage): reuse CollectiblesEmptyState in NFTs section (#26644)
## **Description**
Replaces the custom inline empty state in the NFTs homepage section with
the shared `CollectiblesEmptyState` component, ensuring consistent empty
state UX between the homepage section and the NFTs full view.
**Changes:**
- Replace custom gem icon + import card with `CollectiblesEmptyState`
from `app/components/UI/CollectiblesEmptyState`
- Fix button centering in `TabEmptyState` by adding `self-center` to the
action button (fixes centering for all consumers)
- Remove unused imports (`TouchableOpacity`, `Image`, `SectionCard`,
`gemIcon`, etc.)
- Update test to match new empty state content
## **Changelog**
CHANGELOG entry: null
## **Related issues**
Refs: https://consensyssoftware.atlassian.net/browse/TMCU-407
## **Manual testing steps**
```gherkin
Feature: NFTs section empty state
Scenario: user with no NFTs sees shared empty state
Given user has no NFTs
And user is on the Homepage
When user scrolls to the NFTs section
Then user sees the CollectiblesEmptyState with NFT illustration
And user sees the Import NFTs button centered below the description
And tapping Import NFTs navigates to the AddAsset screen
Scenario: empty state button is centered
Given user has no NFTs
When the empty state is displayed
Then the Import NFTs button is horizontally centered
```
## **Screenshots/Recordings**
### **Before**
<img width="300"
src="https://github.com/user-attachments/assets/f33f9d39-c7d3-4d1c-9afe-3adf8b2a5480"
/>
<!-- Custom gem icon card with left-aligned layout -->
### **After**
<img width="300"
src="https://github.com/user-attachments/assets/19aafd5d-d7f5-4700-b6e9-6046fdc18bd5"
/>
<!-- Shared CollectiblesEmptyState with centered illustration and button
-->
## **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 refactor that swaps the NFTs homepage empty state to a
shared component and adjusts related tests; minor behavior change adds
brief button disabling to prevent repeat taps.
>
> **Overview**
> Replaces the NFTs homepage section’s custom “import NFTs” card with
the shared `CollectiblesEmptyState`, aligning the empty-state UX with
the full NFTs view and removing the bespoke gem/icon layout.
>
> Adds a small guard to temporarily disable the empty-state action
button after tap (re-enabled after 1s), and updates homepage/NFT section
tests to stop asserting on the removed description text.
>
> Fixes `TabEmptyState` action button alignment by applying
`twClassName="self-center"`, affecting all consumers of that component.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
b818f95. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 32ea2f3 commit 3d1f94d
5 files changed
Lines changed: 15 additions & 55 deletions
File tree
- app
- component-library/components-temp/TabEmptyState
- components/Views/Homepage
- Sections/NFTs
- assets
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | 116 | | |
118 | 117 | | |
119 | 118 | | |
| |||
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
88 | 87 | | |
89 | 88 | | |
90 | 89 | | |
| |||
Lines changed: 13 additions & 52 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | | - | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 14 | + | |
23 | 15 | | |
24 | 16 | | |
25 | | - | |
26 | 17 | | |
27 | 18 | | |
28 | 19 | | |
29 | 20 | | |
| 21 | + | |
30 | 22 | | |
31 | 23 | | |
32 | 24 | | |
33 | | - | |
34 | 25 | | |
35 | 26 | | |
36 | 27 | | |
| |||
91 | 82 | | |
92 | 83 | | |
93 | 84 | | |
| 85 | + | |
| 86 | + | |
94 | 87 | | |
| 88 | + | |
95 | 89 | | |
| 90 | + | |
96 | 91 | | |
97 | 92 | | |
98 | 93 | | |
| |||
138 | 133 | | |
139 | 134 | | |
140 | 135 | | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
180 | 141 | | |
181 | 142 | | |
182 | 143 | | |
| |||
Binary file not shown.
0 commit comments