feat(ramps): add AmountInput screen for Unified Buy V2#24814
Conversation
- Add AMOUNT_INPUT route constant to Routes.ts - Create AmountInput boilerplate screen component - Register AmountInput screen in Ramp routes - Add V2 routing logic in useRampNavigation hook - Update TokenSelection to use centralized goToBuy navigation - Add comprehensive tests for V2 routing behavior
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
…to feat/ramps-unified-buy-v2-amount-input
- Add conditional goBack for V1 flow to close modal before navigation - V2 flow navigates within same stack, no modal close needed - Add useRampsUnifiedV2Enabled hook and tests for both flows
- Move ERROR and UNSUPPORTED routing decision checks before V2 routing - Ensures ineligible/unsupported users see error modals, not AmountInput - Add tests for error states taking precedence over V2 routing
|
bugbot run |
…oading
- Add keypad input with currency formatting
- Create custom navbar with token avatar, network badge, and labels
- Use translations for 'Buy {ticker}' and 'on {networkName}'
- Add skeleton loading state when token data is loading
- Always set navigation options immediately to prevent header flash
- Update tests for new skeleton loading behavior
- Create PaymentMethodPill component with card icon, label, and dropdown arrow - Replace token conversion placeholder with PaymentMethodPill - Add translation for 'Debit card' - Match Figma design specs for spacing and sizing - Add tests for PaymentMethodPill component
- Create QuickAmounts component with preset amount buttons (, , , ) - Use Button from design-system-react-native with Secondary variant and Lg size - Buttons align perfectly with keypad using flex: 1 and 12px gap (spacing/3) - Add tests for QuickAmounts component and AmountInput integration
- Rename AmountInput folder and files to BuildQuote - Update createAmountInputNavDetails to createBuildQuoteNavDetails - Rename getRampsAmountInputNavbarOptions to getRampsBuildQuoteNavbarOptions - Update all imports and references - Update testIDs from amount-input-* to build-quote-*
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #24814 +/- ##
========================================
Coverage 79.88% 79.89%
========================================
Files 4231 4239 +8
Lines 108283 108568 +285
Branches 22674 22728 +54
========================================
+ Hits 86503 86741 +238
- Misses 15722 15754 +32
- Partials 6058 6073 +15 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Can we please add a video for this ? |
The BuildQuote component was using useRampTokens() which pulls from the V1 endpoint. Now uses tokens from useRampsController() which uses the V2 RampsController API.
|
LGTM as a check point. Follow up PRs will be needed to implement the selector navigation and move the selectedToken to the controller. |
3805b6c to
074de30
Compare
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsThis PR introduces a new Ramps Unified V2 flow with the following changes:
The existing E2E test
This test will validate that the ramps flow continues to work correctly with the new V2 routing. The changes are additive and feature-flagged behind The Navbar changes are additive (new function only) and don't affect other screens, so no broader testing is needed. |
|
|
There's a bug with the non-integer amounts non-integers.mp4I would remove decimals from the input for buy, but this will be needed in the future for selling. edit: I'm OK with this being fixed when tackling the next stories |



Description
This PR introduces the Amount Input screen as part of the Ramps Unified Buy V2 feature.
What changed:
AMOUNT_INPUTroute constant toRoutes.tsAmountInputcomponent with:QuickAmountscomponent with preset amount buttons ($50, $100, $200, $400) - shown when no amount enteredPaymentMethodPillcomponent showing selected payment methodformatCurrencyutilitygetRampsAmountInputNavbarOptionsin Navbar for custom headeruseRampNavigationhook - when V2 is enabled andassetIdis provided, navigation goes toAmountInputinstead of the legacy flowTokenSelectionto use centralizedgoToBuynavigation with conditional modal dismissal:Why:
When
rampsUnifiedBuyV2feature flag is enabled, users selecting a token in the token list will now navigate to this new Amount Input screen. This sets up the core UI for the V2 buy flow.Changelog
CHANGELOG entry: null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/TRAM-3037
Manual testing steps
Screenshots/Recordings
Before
Token selection → modal closes → Deposit/Aggregator
After
Token selection → Amount Input screen (when V2 enabled) with:
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2026-01-19.at.15.13.06.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Introduces the new Unified Buy V2 amount entry flow and wires navigation to it.
BuildQuote(Amount Input) screen with keypad-driven amount,QuickAmounts,PaymentMethodPill, and currency formatting; registered viaRoutes.RAMP.AMOUNT_INPUTgetRampsBuildQuoteNavbarOptionsshowing token avatar + network badge with skeleton loading and labels (Buy [TICKER]/on [Network])useRampNavigationto route toBuildQuotewhen V2 is enabled and anassetIdis provided; preserves V1 behavior and error/unsupported fallbacksTokenSelectionto conditionally close modal (V1) or stay in-stack (V2); updates tests accordinglyformatCurrencyinapp/components/UI/Ramp/utils/formatCurrencyand re-exports for Deposit utils; adds new i18n stringsRampsService:getPaymentMethodsto ramps controller messenger; extensive unit tests and snapshots for new componentsWritten by Cursor Bugbot for commit 0dcc604. This will update automatically on new commits. Configure here.