Commit f8f3356
authored
feat(ramp): agg / deposit switcher (#22283)
<!--
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 pull request introduces a new "Settings" modal for the buy flow in
the Ramp Aggregator, updates the configuration button icon, and improves
component flexibility and test coverage. The most significant changes
are the addition of the buy settings modal and its integration into the
navigation flow.
### Buy Flow Settings Modal
* Added a new `SettingsModal` component that appears as a bottom sheet,
allowing users to view order history or switch to the new buy
experience. This includes navigation logic and UI elements.
[[1]](diffhunk://#diff-e763577f4d665c8606263239492930e87bf3d4e279cbbac587936cf66d7bd4d8R1-R67)
[[2]](diffhunk://#diff-d6834d985c54e83eea965972a6f2361418b54e52f18fbe81580bba2b09aed830R1)
[[3]](diffhunk://#diff-c97ef93052f382820dc15a75c6550cfb58cb2e02701b00954bf6627ee973dae5R1-R150)
* Integrated the `SettingsModal` into the Ramp Aggregator's modal
navigation stack, making it accessible from the buy flow.
[[1]](diffhunk://#diff-ee3146518eeb9c65ca423e7002936990d4ec0c3960098219f127aabbdecca283R18)
[[2]](diffhunk://#diff-ee3146518eeb9c65ca423e7002936990d4ec0c3960098219f127aabbdecca283R96-R99)
* Provided a utility for generating navigation details for the new modal
(`createBuySettingsModalNavigationDetails`).
[[1]](diffhunk://#diff-8f431ed27f208e5f873f504bd846413111f1b8554ff5e60d1fb34080fa569b4eR103)
[[2]](diffhunk://#diff-e763577f4d665c8606263239492930e87bf3d4e279cbbac587936cf66d7bd4d8R1-R67)
### UI/UX Improvements
* Changed the configuration button icon in the deposit navbar and
associated snapshots from "MoreHorizontal" to "Setting" for clarity and
consistency.
[[1]](diffhunk://#diff-f2cb25f3b00b5754b8b022c689f98cdbe6e3a26ce9cf80906f443477cbe40e94L2027-R2027)
[[2]](diffhunk://#diff-3c3cfd60ca950883ba19a8996fb24e2f2a5ffd3c4b830dc00d10b5f3510b0d0dL186-R186)
[[3]](diffhunk://#diff-3c3cfd60ca950883ba19a8996fb24e2f2a5ffd3c4b830dc00d10b5f3510b0d0dL2060-R2060)
[[4]](diffhunk://#diff-3c3cfd60ca950883ba19a8996fb24e2f2a5ffd3c4b830dc00d10b5f3510b0d0dL3934-R3934)
[[5]](diffhunk://#diff-3c3cfd60ca950883ba19a8996fb24e2f2a5ffd3c4b830dc00d10b5f3510b0d0dL5808-R5808)
[[6]](diffhunk://#diff-3c3cfd60ca950883ba19a8996fb24e2f2a5ffd3c4b830dc00d10b5f3510b0d0dL7621-R7621)
[[7]](diffhunk://#diff-3c3cfd60ca950883ba19a8996fb24e2f2a5ffd3c4b830dc00d10b5f3510b0d0dL9433-R9433)
[[8]](diffhunk://#diff-3c3cfd60ca950883ba19a8996fb24e2f2a5ffd3c4b830dc00d10b5f3510b0d0dL11246-R11246)
[[9]](diffhunk://#diff-3c3cfd60ca950883ba19a8996fb24e2f2a5ffd3c4b830dc00d10b5f3510b0d0dL13152-R13152)
[[10]](diffhunk://#diff-3c3cfd60ca950883ba19a8996fb24e2f2a5ffd3c4b830dc00d10b5f3510b0d0dL14920-R14920)
[[11]](diffhunk://#diff-3c3cfd60ca950883ba19a8996fb24e2f2a5ffd3c4b830dc00d10b5f3510b0d0dL16733-R16733)
[[12]](diffhunk://#diff-3c3cfd60ca950883ba19a8996fb24e2f2a5ffd3c4b830dc00d10b5f3510b0d0dL18546-R18546)
[[13]](diffhunk://#diff-3c3cfd60ca950883ba19a8996fb24e2f2a5ffd3c4b830dc00d10b5f3510b0d0dL20359-R20359)
[[14]](diffhunk://#diff-3c3cfd60ca950883ba19a8996fb24e2f2a5ffd3c4b830dc00d10b5f3510b0d0dL22172-R22172)
* Updated the buy flow to show the configuration/settings button only
when appropriate, and wired up the new modal.
[[1]](diffhunk://#diff-8f431ed27f208e5f873f504bd846413111f1b8554ff5e60d1fb34080fa569b4eR448-R451)
[[2]](diffhunk://#diff-8f431ed27f208e5f873f504bd846413111f1b8554ff5e60d1fb34080fa569b4eR461-R475)
### Testing
* Added comprehensive tests for the new `SettingsModal`, verifying
rendering, navigation, and user interactions.
### Figma Link
-
https://www.figma.com/design/ItZzm9CzSAjOWQTUKsOdSk/BUY?node-id=1084-4960&t=Srhw8LAFlFu5bYM6-4
-
https://www.figma.com/design/ItZzm9CzSAjOWQTUKsOdSk/BUY?node-id=1225-8519&t=Srhw8LAFlFu5bYM6-4
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: Add settings modal for Buy and a switcher between Buy
and Deposit
## **Related issues**
Fixes: https://consensyssoftware.atlassian.net/browse/TRAM-2825
## **Manual testing steps**
```gherkin
Feature: Buy and Deposit
Scenario: user switches to Deposit
Given user is in Buy (Aggregator) flow
When user opens the settings
And taps on the "Use new buy experience" item
Then navigates to Deposit
Scenario: user switches to Buy (Aggregator)
Given user is in Deposit flow
When user opens the settings
And taps on the "More ways to buy" item
Then navigates to Buy (Aggregator)
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
**Buy**
| **Before** | **After** |
|--------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|
| <img
src="https://github.com/user-attachments/assets/88641694-c07f-4b0b-b5cb-25d9cbf8a0fb"
width="250px" /> | <img
src="https://github.com/user-attachments/assets/c60c8989-2df6-474a-aabb-080e7d9f4ead"
width="250px" /> |
**Buy Settings**
| **Before** | **After** |
|--------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|
| N/A | <img
src="https://github.com/user-attachments/assets/98d670a5-949e-48d0-bbcc-67a3e072902a"
width="250px" /> |
**Deposit**
| **Before** | **After** |
|--------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|
| <img
src="https://github.com/user-attachments/assets/a2488522-fc5e-4649-a867-e4245a530512"
width="250px" /> | <img
src="https://github.com/user-attachments/assets/0619e279-6a63-4c98-8ae8-7b4f52d92b1f"
width="250px" /> |
**Deposit Settings**
| **Before** | **After** |
|--------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|
| <img
src="https://github.com/user-attachments/assets/6d0b588c-cb9c-4801-ab3b-37e0e4c4ad5f"
width="250px" /> | <img
src="https://github.com/user-attachments/assets/92596f1b-fc0c-4537-8033-b2f6c65d9658"
width="250px" /> |
**Switcher**
https://github.com/user-attachments/assets/01d1dcb9-fa83-4b91-98cc-a88264d2ee42
## **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]
> Introduces a new buy Settings bottom sheet and navigation, adds a
reusable MenuItem component, updates deposit config UI (incl. new
Setting icon) and strings, and wires a switcher between Buy (Aggregator)
and Deposit.
>
> - **Ramp Aggregator (Buy)**:
> - **New settings modal**: Adds `SettingsModal` bottom sheet
(`Routes.RAMP.MODALS.SETTINGS`), opened from `BuildQuote` when buying;
options to view order history and switch to Deposit.
> - **Navigation**: Registers modal in `routes/index.tsx` and provides
`createBuySettingsModalNavigationDetails`.
> - **Deposit**:
> - **Config modal refresh**: Uses header, shared `MenuItem`, adds "More
ways to buy" to navigate to Aggregator; keeps order
history/support/logout; removes old styles file.
> - **Navbar icon**: Changes configuration button icon to
`IconName.Setting`.
> - **Shared Components**:
> - **MenuItem**: New reusable list item
(`app/components/UI/Ramp/components/MenuItem`) with icon/title/optional
description.
> - **Localization & Routes**:
> - Adds/updates strings for settings, logout label, and new menu items;
adds `RampSettingsModal` route key.
> - **Tests/Snapshots**:
> - Adds tests for `SettingsModal` and `MenuItem`; updates snapshots for
icon/name and new UI.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
9c02608. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 61d7fe8 commit f8f3356
File tree
19 files changed
+1886
-206
lines changed- app
- components/UI
- Ramp
- Aggregator
- Views
- BuildQuote
- Modals/Settings
- __snapshots__
- routes
- Deposit/Views
- BuildQuote/__snapshots__
- Modals/ConfigurationModal
- __snapshots__
- components/MenuItem
- __snapshots__
- locales/languages
19 files changed
+1886
-206
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1962 | 1962 | | |
1963 | 1963 | | |
1964 | 1964 | | |
1965 | | - | |
| 1965 | + | |
1966 | 1966 | | |
1967 | 1967 | | |
1968 | 1968 | | |
| |||
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| |||
417 | 418 | | |
418 | 419 | | |
419 | 420 | | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
420 | 425 | | |
421 | 426 | | |
422 | 427 | | |
| |||
426 | 431 | | |
427 | 432 | | |
428 | 433 | | |
| 434 | + | |
| 435 | + | |
429 | 436 | | |
430 | 437 | | |
431 | 438 | | |
432 | 439 | | |
433 | 440 | | |
434 | | - | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
435 | 449 | | |
436 | 450 | | |
437 | 451 | | |
| |||
Lines changed: 150 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 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 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
Lines changed: 67 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
0 commit comments