-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
refactor(ramps): use bottom sheet modal for ramp region selection #20558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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. |
…gator-region-modal
queryDefaultFiatCurrency, | ||
selectedPaymentMethodId, | ||
setSelectedFiatCurrencyId, | ||
]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Infinite Loop in useEffect
Dependencies
The useEffect
(lines 229-258) includes selectedFiatCurrencyId
in its dependencies and updates it, which can lead to an infinite loop or redundant executions. This also introduces a race condition with queryDefaultFiatCurrency
and triggers fiat currency updates on mount or other dependency changes, unlike the previous explicit region selection.
trackEvent('RAMP_REGION_SELECTED', { | ||
country_id: region.id, | ||
location: 'Amount to Buy Screen', | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Modal Analytics Location Property Misconfigured
The RegionSelectorModal
hard-codes the analytics location
property to 'Amount to Buy Screen'. This results in incorrect analytics data when the modal is used in a sell flow, as the location should dynamically reflect whether it's a buy or sell transaction.
Description
This PR refactors the ramp aggregator region modal to use the new bottom sheet navigation pattern.
Changelog
CHANGELOG entry:
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Replaces inline region modal with a bottom-sheet RegionSelectorModal, updates BuildQuote to navigate to it and react to region changes, adds routing, and updates tests and deposit modal list rendering.
RegionModal
with bottom-sheetRegionSelectorModal
(components/RegionSelectorModal/*
).BuildQuote
: navigate to region selector viacreateRegionSelectorModalNavigationDetails
; remove local region modal state/handlers.selectedRegion
change and to auto-switch fiat currency to region default when applicable.Routes.RAMP.MODALS.REGION_SELECTOR
and register screen inroutes/index.tsx
.Deposit/RegionSelectorModal
: switch toListItemSelect
, simplify styles, and remove extra scrolling flags.BuildQuote.test.tsx
to assert navigation toRampRegionSelectorModal
instead of directly setting region.Written by Cursor Bugbot for commit a7cf186. This will update automatically on new commits. Configure here.