Design comparison
Solution retrospective
This is my first React-Typescript project, and it was quite an interesting journey filled with lots of new learning opportunities. It took some time to get everything in place.
Weak Points:
- The use of react-router in this specific case was a bit confusing when navigating through the page, which made me doubt whether it was the right solution or not.
- Using TypeScript made many things easier and eliminated a lot of potential errors along the way, but I realize that the indiscriminate use of 'any' wasn't the best choice in some cases, and in others, the type declarations could perhaps be improved.
- After analyzing more advanced projects from others, I could see that maybe a more appropriate organization of the project structure and components in general could have been applied.
Despite everything, it was a lot of fun, as always. I look forward to your advice and feedback, and thank you in advance ;) .
Community feedback
- @brunomoletaPosted 7 months ago
Buona sera Marcos,
I've reviewed this project of yours also with a PR and everything. First, do not feel obliged to accept the pull request.
Unfortunately, I ended up breaking the filter feature :(.I wanted to clean up the
action
prop that was hard to understand.And I know it's unnecessary to have that, though I couldn't go around it. But please check out the Git commits, as I made an effort to make each as specific as possible.
The main thing I did was to organize the states using Zustand state manager. Also, your Button component had a reserved word "type" at your prop. I changed the name to
isLink
with the boolean type since it is a link or not.Please also check the initial color setter function. I believe it got cleaner.
The feat you did at filtering the form as the user types is swell. Congratulations on developing it.
Best regards from Brasile, Bruno
Marked as helpful0@Dantalian5Posted 6 months ago@brunomoleta Hello Bruno,
First off, thank you for your effort and advice; they have been outstanding. Regarding the pull request, I've used it on a separate branch to see if I could fix the filter error. As I progressed in reviewing the code and your additions, I realized something—my code had been extremely careless, disorganized, and in some cases, very poorly structured (it's a miracle it didn't fail before). It was impossible for me to track the changes and make modifications without breaking other things. Thank you for taking the time to review and improve it. So, I decided to redo it, fix the errors from scratch, and also add your contributions (always trying to credit them).
- Reorganize the page, more precisely using your advice to switch to a page and route structure (I loved it).
- Add Zustand as a state manager (wonderful) and create stores for color themes and filters.
- Fix the filter, completely restructure the form and its components, and clean up the input effects (apparently, I was the only one who liked the moving placeholder effect), as well as fixing the checkbox component. Seeing that you had resorted to an external library, I created a component based on the previous failures, focusing on accessibility and control, while maintaining correspondence with the interface.
- Fix the buttons and create two separate components, Button and ButtonLink (I could have combined them, but it seemed more organized this way), with clearer properties, and taking advantage of the intrinsic properties of their respective tags. Also, I corrected the action property error, this time falling on onSubmit or onClick as intrinsic properties.
- The initial function for choosing the theme was brilliant, so I adapted it a bit to be more my style.
Sorry for the long explanation, but I believe the effort you took to review my code deserves even more work on my part. I've added some other changes, always aiming for a clean and understandable structure, and paying a lot of attention to accessibility, although I still have issues dealing with rem/px measurements when setting up the user interface.
I wish you the best of luck, and I hope to continue to have your support and advice.
Greetings from Italy: Marcos Valenzuela
1
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord