-
Notifications
You must be signed in to change notification settings - Fork 22
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
[ECO-2313] Fix input fields on market and pools pages #308
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
...escript/frontend/src/components/pages/emojicoin/components/trade-emojicoin/SwapComponent.tsx
Show resolved
Hide resolved
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.
So as we discussed on call I think this is fairly complex because we're doing manual form validation with a custom decimal display (from the Aptos coin module)
I think there's two ways we can go with this:
- Add several unit tests specifically for the functions used in these components, and maybe a couple in playwright as well with actual input changes. This would be faster but it will continue to be difficult to maintain and update, although this likely won't change much again, + with tests it's easier to update safely.
- Refactor this to use some form validation library and minimize the amount of code we use and make it modular for any future frontend stuff we do with input + display coin decimal formatting
If we go with #1 I think it's important to also document what all the various regex patterns do- at least the ones that take more than 5 seconds (for a human) to parse and understand
I'm comfortable with either one, so it's up to you to choose. if I had to choose, I'd say number 2
Description
This PR fixes input fields on the market and the pools pages.
Before, inputing small values would glitch the inputs.
Now, you can input values as small as 0.00000001, which is the smallest number you can trade.
Testing
Input small values on the market and the pools pages in vercel.