feat: add PayWithBottomSheet component#29904
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
The changes directly affect the confirmation pay-with flow (EIP-7702 advanced features, gas fee token payments). The feature flag means the new bottom sheet won't appear in standard E2E runs unless the flag is enabled, but the navigation logic change in No other tags are needed: the changes don't touch swap/bridge flows (SmokeSwap), staking (SmokeStake), account management (SmokeAccounts), network management (SmokeNetworkAbstractions), or other areas. The App.tsx change is minimal (one new screen registration) and doesn't affect navigation for other flows. Performance Test Selection: |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #29904 +/- ##
=======================================
Coverage 81.50% 81.51%
=======================================
Files 5328 5332 +4
Lines 141146 141195 +49
Branches 32157 32174 +17
=======================================
+ Hits 115046 115090 +44
Misses 18239 18239
- Partials 7861 7866 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|



Description
Introduces the foundation for the redesigned MMPay payment picker (CONF-1313). When the dev override is enabled, tapping the "Pay with" row on confirmation screens opens a new empty bottom sheet instead of the existing token picker (
PayWithModal). All subsequent epic PRs (Crypto/Perps/Predict/Bank-Card sections) will plug into this scaffolding.What's added:
PayWithBottomSheetmodal atcomponents/modals/pay-with-bottom-sheet/using@metamask/design-system-react-nativeBottomSheetPayWithSectionUI primitive atcomponents/UI/pay-with-section/— renders a section header + rows from configPaymentMethodRowUI primitive atcomponents/UI/payment-method-row/— icon, title/subtitle, trailing element (checkmark / chevron / custom node), optional<Tag label="Last used" />PayWithSectionConfigandPayWithRowConfigTypeScript interfaces — the contract every future section hook will implementusePayWithSections()orchestrator hook skeleton (returns[]for now; PRs 2–7 will plug in section configs)Routes.CONFIRMATION_PAY_WITH_BOTTOM_SHEETregistered inApp.tsxpay-with-row.tsxnow routes to the new bottom sheet when the gate is on, falls back to the existingPayWithModalotherwise — zero behavior change for usersGating:
PayWithModalMM_DEV_PAY_WITH_BOTTOM_SHEET(set in.js.env) flips the route locally without touching the sharedconfirmations_pay_fiatremote flag, so it doesn't collide with parallel fiat workChangelog
CHANGELOG entry: null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/CONF-1357
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist