Closed skredev closed 1 month ago
@sprechblase Thanks for making this PR, it's great UX idea!
I believe the whole logic could be simplified, I'm gonna write a few comments about it. From my perspective, it's quite hard to digest what's the difference between:
value
internalValue
defaultValue
As review comments are not sorted in a same way when I wrote them, it might be complicated to read them.
The idea is to have only one useState
which will store values like { from: number, to: number}
.
Then refactor ComboBox, remove defaultValue
and internalValue
only leave value
prop.
After that adapt other places in code base where defaultValue
was used.
If you have any questions or need help, please let me know!
@sprechblase I left few comments about refactoring and simplifying logic, please once you're done with it, don't forget to change defaultValue
to value
in these components:
pages/utilities/css-units-converter.tsx
- lines 145 and 153pages/utilities/image-resizer.tsx
- line 259If you need any help please let me know, it might be too much changes, but I believe it's gonna make DX easier in the future!
@peckz I made all the changes you requested and also added the new Switch button and the new simplified logic to the CSS Units Converter.
Thank you very much for your feedback!
@sprechblase Thank you! Welcome to the contributors list! ๐
This is so awesome, I love it! Thank you for adding this! ๐
Can we send you a Jam hat? ๐งข My email is dani@jam.dev โ let me know a good mailing address for you and a hat will be on its way!
Hello everyone!
I've added a toggle button between the from and to inputs to quickly toggle the conversion in the Number Base Changer, as requested in #57. This feature enables users to switch between the two options with greater ease and convenience.
The switch button can now also be added to other utilities that use the ComboboxComponent. The ComboboxComponent has been updated without affecting other use cases that do not utilize the switch button.
Looking forward to hearing your feedback! ๐