Commit d6fd3c4
authored
fix(homepage): add dot separator between price and variation for token rows (TMCU-569) (#27449)
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
This PR adds a dot separator (•) between the price and variation text in
token rows on the homepage, aligning with the `price • variation` format
used in `TokenListItemV2`.
**1. What is the reason for the change?**
- Token rows in the Cash section and Popular Tokens section did not
follow the same layout as token list items
- `TokenListItemV2` displays price and variation as `$1.00 • +5.25%` (or
similar)
- The MUSD row in Cash and the Popular Token rows were missing this
separator
**2. What is the improvement/solution?**
- Insert the Unicode bullet (`\u2022`) between the price and variation
- Update `PopularTokenRow` so price and percentage display as `price •
variation`
- Update `CashGetMusdEmptyState` for the MUSD empty state
- Adjust test assertions in `PopularTokenRow.test.tsx` to match the new
format
## **Changelog**
CHANGELOG entry: Fixed token row display on homepage to show price and
variation separated by a dot for consistency with token list items
## **Related issues**
Fixes:
[TMCU-569](https://consensyssoftware.atlassian.net/browse/TMCU-569)
## **Manual testing steps**
```gherkin
Feature: Homepage token row display consistency
Scenario: user views token rows with price and variation
Given the user is on the Homepage
And the Cash section shows MUSD or Popular Tokens shows tokens with price/variation
When the user views the token row
Then price and variation are separated by a dot (•)
And the layout matches TokenListItemV2 (e.g. "$1.00 • 3% bonus" or "$1,234.56 • +5.25%")
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<img width="300"
src="https://github.com/user-attachments/assets/b81022c5-6d85-4f86-9b74-f246503b8475"
/>
### **After**
<img width="300"
src="https://github.com/user-attachments/assets/03c27fe4-07d0-49fa-947f-3fa1ca12efaa"
/>
## **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.
## **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-only change to text/layout formatting plus corresponding
test updates; no data, auth, or navigation logic changes.
>
> **Overview**
> Aligns homepage token rows with the `price • variation` display by
inserting a Unicode bullet separator between the price and
percentage/bonus text.
>
> Updates `PopularTokenRow` to render the separator *only when* a
percentage value is present (and simplifies the layout), and tweaks
`CashGetMusdEmptyState` to show the same separator for the mUSD row.
Tests are updated to assert the new formatting and ensure no trailing
bullet appears when variation is absent/invalid.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
dcda7cd. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 69f4c71 commit d6fd3c4
File tree
3 files changed
+37
-20
lines changed- app/components/Views/Homepage/Sections
- Cash
- Tokens/components
3 files changed
+37
-20
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
| 204 | + | |
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
| 209 | + | |
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| |||
Lines changed: 28 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
87 | | - | |
| 86 | + | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
| 96 | + | |
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
| |||
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
127 | | - | |
| 128 | + | |
128 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
129 | 145 | | |
130 | 146 | | |
131 | 147 | | |
| |||
138 | 154 | | |
139 | 155 | | |
140 | 156 | | |
141 | | - | |
142 | | - | |
| 157 | + | |
| 158 | + | |
143 | 159 | | |
144 | 160 | | |
145 | 161 | | |
| |||
293 | 309 | | |
294 | 310 | | |
295 | 311 | | |
296 | | - | |
297 | | - | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
298 | 315 | | |
299 | 316 | | |
300 | 317 | | |
301 | 318 | | |
302 | 319 | | |
303 | 320 | | |
304 | 321 | | |
305 | | - | |
306 | | - | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
307 | 325 | | |
308 | 326 | | |
309 | 327 | | |
Lines changed: 7 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| 225 | + | |
225 | 226 | | |
226 | 227 | | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
235 | 234 | | |
236 | 235 | | |
237 | 236 | | |
| |||
0 commit comments