[READY] handle the response when quote exceeds the pool size#661
Conversation
✅ Deploy Preview for pendulum-pay ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull Request Overview
This PR refactors several UI components to improve their handling of loading states and cleans up unused code. Key changes include the removal of an unused import in the ramp hook, conditional class adjustments in the AssetButton component, and the introduction of a loading prop in the NumericInput and AssetNumericInput components.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| frontend/src/hooks/offramp/useSubmitRamp.ts | Removed an unused constant import and fixed a trailing comma |
| frontend/src/components/buttons/AssetButton/index.tsx | Refactored className handling using a helper for conditional classes |
| frontend/src/components/NumericInput/index.tsx | Added a new loading prop with updated conditional rendering for spinner |
| frontend/src/components/AssetNumericInput/index.tsx | Passed loading prop down to NumericInput and updated prop references |
Comments suppressed due to low confidence (1)
frontend/src/components/buttons/AssetButton/index.tsx:16
- Consider adding an accessible label (e.g., 'aria-label') to the button element in AssetButton to improve screen reader support.
<button
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
ebma
left a comment
There was a problem hiding this comment.
I think we should still allow changing the asset when the quote does not load. It could be that for a different output asset, we can get a quote. Otherwise the user would first have to edit their input amount which could be confusing again.
We could also consider adding an error message.
…t-amount-exceeds-the-swap-pool-reserves
|
@ebma fixed |
ebma
left a comment
There was a problem hiding this comment.
I can now still change the output token which is great. We are still not telling the user what's wrong though.
To keep it simple, how about we just check the response code instead of looking at the contained error? If it's a 500 we assume that the quote cannot be served because the input amount is too low.
The ideal solution would be to change the responses of the backend to tell the frontend what exactly is wrong. This is a little trickier and maybe not worth it just for this. Your call @Sharqiewicz but we need to have at least some messaging telling the user what's wrong and what they can do.
…t-amount-exceeds-the-swap-pool-reserves

Update the output to visually and textually show that the quote is loaded, even if an error message about exceeding the pool size is returned.