Coffeeroasters subscription site | React, Unit Tests, End-to-End Tests

Solution retrospective
Hello frontend friends! 👋
This was long overdue but I finally completed my 4th challenge on Frontend Mentor. 🎉
I have been learning React
since the beginning of 2022 and this project was a great opportunity for me to put what I've learnt into practice. Check my readme.md for more details.
Major challenge(s):
- I decided to use
React
withTypescript
and I had some difficulties in getting the right types for components props. - I really wanted to get the real development experience so I added unit tests for the components and end-to-end tests for the order scenarios.
- I have yet to add unit test for the custom hook.
- I still have to figure out how to set the redirection properly for a
React
application on Netlify.
Bonus:
- I added some form feedback if the user tries to create a plan without selecting any options.
- I added a skeleton preloader while the page content loads. I always wanted to implement such a feature and therefore I tried to come up with a solution for that using
React
.
It took me quite a while to complete this challenge because I was going back and forth in the React
documentation and best practices. I really enjoyed that and I'm also happy with the result.
Your feedback would be much appreciated.
Thanks in advance. 🙏
Please log in to post a comment
Log in with GitHubCommunity feedback
- P@dwhenson
Hi Christopher,
Lovely, lovely job here! I'm also pretty new to React and have been learning it for a few months so it's nice to find a fellow student.
I noticed a couple of problems with the final modal 1) Keyboard focus doesn't move there and 2) The body remains scrollable.
I've been lucky to be an early test on Josh Comeau's Joy of React course and just yesterday did the modal lesson. It can be really hectic, but there's a couple of packages that can basically solve this for you:
- react-focus-lock - moves and locks focus to the modal
- react-remove-scroll - removes scroll from all other elememts
I've not tried them on a project but they seem pretty simple to implement and it might be worth giving them a try?
Cheers Dave
Marked as helpful - @denielden
Hi Christopher, You did a spectacular job! 😁
Above all I really like the preload part with the same style as the facebook comments.
To set up the redirect on Netlify correctly, add a file called
_redirects
with/* /index.html 200
in thepublic
folder of the react project.Note that this redirection should also be done on production sites outside of Netlify but using an
.htaccess
file instead of_redirects
.I wanted to peek at your code but I can't find the repository in your git
Hope this help 😉 and Happy coding!
Marked as helpful
Join 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