Closed theflucs closed 8 months ago
Visit the deploys page to approve it
Name | Link |
---|---|
Latest commit | 68b8d3b470eff21fd1adcbef6284889d9f2745eb |
Instead of writing an util to close the dropdown, which we have to remember to add on each new dropdown, I'd probably go with a generic Dropdown component that handles the logic by itself.
@Balastrong this refactoring has been quite a journey! At the end of which I am not sure it's worth to have it, because It added a level of complexity to the code base. Have a look and tell me what you think. Anyway it's been interesting to implement it for the sake of learning.
I also had to touch the ThemeSelector
test, see the fix test error
commit. It's not clear to me why it got broken after my changes.
Thank you
Added the functionality of closing the dropdown as soon as one of its item is clicked.
There are few repetitions in the code, though: one is about the export dropdown, which can be resolved creating an
ExportDropdownButton
component. The second one is about the use of thecloseDropdownOnItemClick
util function, which is attached to the dropdown anytime we use it. If we decide to have this functionality throughout the app, maybe a component wrapper could be helpful?@Balastrong what do you think about these considerations?
I leave the PR on draft for now. Thank you