Commit 9e56b9f
authored
fix(ramps): match Build Quote payment pill to payment selection modal (#28392)
## Description
Unified Buy v2 **Build Quote** on `main` shows the generic **card** icon
in the payment pill even when a real method (e.g. **Apple Pay**) is
selected, because the pill did not receive `paymentMethod`.
This PR passes `selectedPaymentMethod` into **`PaymentMethodPill`**,
which renders **`PaymentMethodIcon`** the same way as
**`PaymentMethodListItem`** in the payment selection modal:
`paymentMethodType` with the same cast, and **`colors.primary.default`**
for the icon (parity with a **selected** row in the sheet). No extra
parsing helpers and no Aggregator changes.
## Changelog
CHANGELOG entry: Fixed payment method icon on Buy Build Quote to match
the payment selection modal
## Related issues
Refs: TRAM-3401
## Manual testing steps
```gherkin
Feature: Unified Buy Build Quote payment pill
Scenario: Pill matches selected method in payment modal
Given the user is on Build Quote with a payment method selected
When they compare the pill leading icon to that method’s row in the payment selection modal
Then the glyph and treatment match (same PaymentMethodIcon path as the list; primary color on the pill)
Scenario: Pill shows card when no method
Given the user has not selected a payment method
When they view the pill
Then the generic card icon is shown
```
## Screenshots/Recordings
### Before (`main` branch)
<img width="1206" height="2622" alt="image"
src="https://github.com/user-attachments/assets/218cb58d-ae7a-40e6-8aa6-f36659a83847"
/>
### After (this PR)

## 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
- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] 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: the Build Quote payment pill now renders a
real payment-method icon when a payment type is available, with
test/snapshot updates. No changes to quote fetching, routing, or
controllers.
>
> **Overview**
> **Build Quote’s payment pill now mirrors the payment selection modal
iconography.** `BuildQuote` passes `selectedPaymentMethod` into
`PaymentMethodPill`, enabling the pill to render `PaymentMethodIcon`
(primary color) when a `paymentType` is present, and fall back to the
generic card icon otherwise.
>
> Tests were updated to include `paymentType` in the mocked payment
method, add coverage for rendering `PaymentMethodIcon` on any non-empty
`paymentType`, and refresh affected snapshots.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
f0bf9dd. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 5d16844 commit 9e56b9f
5 files changed
Lines changed: 157 additions & 47 deletions
File tree
- app/components/UI/Ramp
- Views/BuildQuote
- __snapshots__
- components/PaymentMethodPill
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
| 304 | + | |
| 305 | + | |
304 | 306 | | |
305 | 307 | | |
306 | 308 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
923 | 923 | | |
924 | 924 | | |
925 | 925 | | |
| 926 | + | |
926 | 927 | | |
927 | 928 | | |
928 | 929 | | |
| |||
Lines changed: 84 additions & 42 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
337 | | - | |
338 | | - | |
339 | | - | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
343 | | - | |
344 | | - | |
345 | | - | |
| 343 | + | |
| 344 | + | |
346 | 345 | | |
347 | 346 | | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
348 | 353 | | |
349 | 354 | | |
350 | | - | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
351 | 358 | | |
352 | 359 | | |
353 | 360 | | |
| |||
1033 | 1040 | | |
1034 | 1041 | | |
1035 | 1042 | | |
1036 | | - | |
1037 | | - | |
1038 | | - | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
1039 | 1046 | | |
1040 | 1047 | | |
1041 | 1048 | | |
1042 | | - | |
1043 | | - | |
1044 | | - | |
| 1049 | + | |
| 1050 | + | |
1045 | 1051 | | |
1046 | 1052 | | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
1047 | 1059 | | |
1048 | 1060 | | |
1049 | | - | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
1050 | 1064 | | |
1051 | 1065 | | |
1052 | 1066 | | |
| |||
1732 | 1746 | | |
1733 | 1747 | | |
1734 | 1748 | | |
1735 | | - | |
1736 | | - | |
1737 | | - | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
1738 | 1752 | | |
1739 | 1753 | | |
1740 | 1754 | | |
1741 | | - | |
1742 | | - | |
1743 | | - | |
| 1755 | + | |
| 1756 | + | |
1744 | 1757 | | |
1745 | 1758 | | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
1746 | 1765 | | |
1747 | 1766 | | |
1748 | | - | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
1749 | 1770 | | |
1750 | 1771 | | |
1751 | 1772 | | |
| |||
2431 | 2452 | | |
2432 | 2453 | | |
2433 | 2454 | | |
2434 | | - | |
2435 | | - | |
2436 | | - | |
| 2455 | + | |
| 2456 | + | |
| 2457 | + | |
2437 | 2458 | | |
2438 | 2459 | | |
2439 | 2460 | | |
2440 | | - | |
2441 | | - | |
2442 | | - | |
| 2461 | + | |
| 2462 | + | |
2443 | 2463 | | |
2444 | 2464 | | |
| 2465 | + | |
| 2466 | + | |
| 2467 | + | |
| 2468 | + | |
| 2469 | + | |
| 2470 | + | |
2445 | 2471 | | |
2446 | 2472 | | |
2447 | | - | |
| 2473 | + | |
| 2474 | + | |
| 2475 | + | |
2448 | 2476 | | |
2449 | 2477 | | |
2450 | 2478 | | |
| |||
3130 | 3158 | | |
3131 | 3159 | | |
3132 | 3160 | | |
3133 | | - | |
3134 | | - | |
3135 | | - | |
| 3161 | + | |
| 3162 | + | |
| 3163 | + | |
3136 | 3164 | | |
3137 | 3165 | | |
3138 | 3166 | | |
3139 | | - | |
3140 | | - | |
3141 | | - | |
| 3167 | + | |
| 3168 | + | |
3142 | 3169 | | |
3143 | 3170 | | |
| 3171 | + | |
| 3172 | + | |
| 3173 | + | |
| 3174 | + | |
| 3175 | + | |
| 3176 | + | |
3144 | 3177 | | |
3145 | 3178 | | |
3146 | | - | |
| 3179 | + | |
| 3180 | + | |
| 3181 | + | |
3147 | 3182 | | |
3148 | 3183 | | |
3149 | 3184 | | |
| |||
3829 | 3864 | | |
3830 | 3865 | | |
3831 | 3866 | | |
3832 | | - | |
3833 | | - | |
3834 | | - | |
| 3867 | + | |
| 3868 | + | |
| 3869 | + | |
3835 | 3870 | | |
3836 | 3871 | | |
3837 | 3872 | | |
3838 | | - | |
3839 | | - | |
3840 | | - | |
| 3873 | + | |
| 3874 | + | |
3841 | 3875 | | |
3842 | 3876 | | |
| 3877 | + | |
| 3878 | + | |
| 3879 | + | |
| 3880 | + | |
| 3881 | + | |
| 3882 | + | |
3843 | 3883 | | |
3844 | 3884 | | |
3845 | | - | |
| 3885 | + | |
| 3886 | + | |
| 3887 | + | |
3846 | 3888 | | |
3847 | 3889 | | |
3848 | 3890 | | |
| |||
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
6 | 19 | | |
7 | 20 | | |
8 | 21 | | |
| |||
58 | 71 | | |
59 | 72 | | |
60 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
61 | 103 | | |
62 | 104 | | |
63 | 105 | | |
| |||
Lines changed: 28 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
| |||
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| 16 | + | |
14 | 17 | | |
| 18 | + | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
18 | 26 | | |
19 | 27 | | |
20 | 28 | | |
| |||
24 | 32 | | |
25 | 33 | | |
26 | 34 | | |
| 35 | + | |
| 36 | + | |
27 | 37 | | |
28 | 38 | | |
29 | 39 | | |
30 | 40 | | |
31 | 41 | | |
32 | 42 | | |
33 | 43 | | |
| 44 | + | |
34 | 45 | | |
35 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
36 | 51 | | |
37 | 52 | | |
38 | 53 | | |
| |||
53 | 68 | | |
54 | 69 | | |
55 | 70 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
61 | 84 | | |
62 | 85 | | |
63 | 86 | | |
| |||
0 commit comments