feat(ramps): adds payment selection modal#25681
Conversation
|
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. |
app/components/UI/Ramp/components/PaymentSelectionModal/PaymentMethodListItem.tsx
Show resolved
Hide resolved
app/components/UI/Ramp/components/PaymentSelectionModal/ProviderSelection.tsx
Show resolved
Hide resolved
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
app/components/UI/Ramp/components/PaymentSelectionModal/ProviderSelection.tsx
Outdated
Show resolved
Hide resolved
app/components/UI/Ramp/components/PaymentSelectionModal/PaymentSelectionModal.tsx
Outdated
Show resolved
Hide resolved
43677f1 to
86fabf8
Compare
app/components/UI/Ramp/components/PaymentSelectionModal/PaymentSelectionModal.test.tsx
Show resolved
Hide resolved
|
This is looking great! 🔥 |
amitabh94
left a comment
There was a problem hiding this comment.
Minor comments but overall looks 💯
| const translateX = useSharedValue(0); | ||
|
|
||
| const paymentPageStyle = useAnimatedStyle(() => ({ | ||
| transform: [{ translateX: translateX.value }], | ||
| })); | ||
|
|
||
| const providerPageStyle = useAnimatedStyle(() => ({ | ||
| transform: [{ translateX: translateX.value + screenWidth }], | ||
| })); | ||
|
|
||
| const handleChangeProviderPress = useCallback(() => { | ||
| translateX.value = withTiming(-screenWidth, { | ||
| duration: ANIMATION_DURATION, | ||
| }); | ||
| }, [screenWidth, translateX]); | ||
|
|
||
| const handleProviderBack = useCallback(() => { | ||
| translateX.value = withTiming(0, { duration: ANIMATION_DURATION }); | ||
| }, [translateX]); | ||
|
|
||
| const handleProviderSelect = useCallback( | ||
| (provider: Provider) => { | ||
| setSelectedProvider(provider); | ||
| translateX.value = withTiming(0, { duration: ANIMATION_DURATION }); | ||
| }, | ||
| [setSelectedProvider, translateX], | ||
| ); | ||
|
|
There was a problem hiding this comment.
Can we double check if this is the best way to do horizontal animation and there isn't already a helper that is being used in other modals?
...nents/UI/Ramp/Deposit/Views/Modals/PaymentMethodSelectorModal/PaymentMethodSelectorModal.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Looks like we are updating more than we should.
…obile into payment-method-modal
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
All changes are scoped to the Ramps feature (app/components/UI/Ramp/). The SmokeRamps tag covers the off-ramp token amount input screen, on-ramp flows, and payment method selection - all of which could be affected by these changes. No other features (confirmations, wallet platform, accounts, etc.) are impacted by these changes. Performance Test Selection: |
|



Description
Introduces the payment selection modal and payment selection flow. Users can choose a payment method (e.g. debit/credit card). Quotes and an option to change provider coming soon.
Changelog
CHANGELOG entry: adds functionality for selecting a payment method
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Loom video of the feature working:
https://www.loom.com/share/bfcf206254ff46b48107f8efb55875e5
Loading state:

Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Touches Ramp navigation and selection state (payment method/provider) and upgrades
@metamask/ramps-controller, which could affect runtime behavior across the ramps flow despite being mostly additive and UI-focused.Overview
Adds a new payment selection bottom sheet modal to the Ramp buy flow, letting users pick a
paymentMethod(and a stubbed provider-selection view) and persisting the choice viauseRampsController.setSelectedPaymentMethod.Updates
BuildQuoteto use controller-managedselectedToken/selectedPaymentMethod(instead of route param lookup), display a “Select payment method” placeholder, show a loading spinner/disable interaction while payment methods load, and navigate to the new modal. Also centralizes payment-delay string formatting into sharedAggregator/utilshelpers and bumps@metamask/ramps-controllerto^7.0.0, with new/updated tests and snapshots covering the modal, pill loading state, and navigation.Written by Cursor Bugbot for commit 4c37973. This will update automatically on new commits. Configure here.