-
Notifications
You must be signed in to change notification settings - Fork 23
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
Refactor: Decompose swap form #200
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@chapati23 The 'Continue' button is disabled upon entering the swap-in amount; I can't actually do a swap with that. It looks like the bug that I fixed already. Have you updated the main branch before checkout? If not, try to do a rebase first. |
When an allowance is less or equal to approveAmount, then we have the opportunity to swap directly without sending the approval tx - it doesn't send the swap tx for the first time. You should close the 'Performing Swap' popup and try to click the 'Swap' button again. I checked, and this reproduces on prod as well, but maybe you can resolve it here, or I will resolve it myself in my PR. What do you think? |
@Andrew718PLTS i refactored the whole buttonText & disabled status logic into a can you re-test all cases? locally it all looked good to me now and all button text & disabled statuses made sense |
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.
@chapati23 I re-tested it using the latest Vercel preview (your last changes have been deployed successfully) and locally.
- All the states display correctly.
- The 'Swap' tx is sent once you click the corresponding button on the 'Confirm Swap' page.
Description
While trying to debug, I got very annoyed with the unwieldiness of the SwapForm with lots of components and hooks inlined in the same file.
This PR is about decomposing the SwapForm into smaller parts. It extracts components and hooks into individual files and aims at making the DX for this feature better.
Other changes
I also upgraded yarn from 3.3.1 to 4.6.0 while I was at it, hence the
yarn.lock
update, but no dependencies where actually changed or updated.Tested
I checked that swaps still work in both directions and with or without approvals.
How to review
Everything should work exactly as it does on production right now, no functionality should have changed.