Coffeeroasters subscription site | React, Unit Tests, End-to-End Tests
Design comparison
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. š
Community feedback
- @dwhensonPosted about 2 years ago
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 helpful1@christopher-adolphePosted about 2 years agoHi @dwhenson š
That's a really good catch. I disabled mouse scrolling when the modal is opened but I completed missed that the modal wasn't accessible via the keyboard. I'll definitely have look at those packages and release a fix for that issue.
I'll also have a look at this
Joy of React
course when it will be available. It sounds interesting as per the description on the website. What is your feedback about it so far ? Would you recommend it ?Thanks for this helpful review.
Best regards.
1@dwhensonPosted about 2 years ago@christopher-adolphe I think Josh will open it up in January for early purchases at a discount (but it won't be finished). His CSS course is 50% off today - grab it if you can!
His courses aren't cheap. But they are really, really good. I learnt a lot on the CSS one, and I already knew quite a bit of CSS (don't worry if you're not a JavaScript developer, I certainly am not!)
For React, I didn't know any React at all before starting, so it's harder for me to comment. But I suspect it'll also be really good. I know from interacting with Josh he is really taking care to make it great.
I have only learnt from that course and have a long way today, but did a couple of React challenges from here the other week, and felt pretty good about that!
If you can afford them, I think both are a really solid investment.
Cheers Dave
0@christopher-adolphePosted about 2 years ago@dwhenson The quality of Josh's blog content is great so I can only imagine that same goes for the courses he creates. The price is definitely something that plays against me. Even with purchasing power parity applied, it's not easy to afford for me.
I'll check the course when it's out and take a decision from there.
Thanks again.
Best regards.
0 - @denieldenPosted about 2 years ago
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 helpful1@christopher-adolphePosted about 2 years agoHi @denielden š
I really appreciate your comments and thanks for the redirection tip. It's working fine now. š
I decided to add this preloading as I mocked an
HTTP Get
request for the page content. It was a good opportunity for me to try implementing this skeleton loader withReact
.As for the Git repository, I completely forgot to change the setting back to public... my bad. You should be able to look into the code by now.
Best regards.
1@denieldenPosted about 2 years ago@christopher-adolphe it was a pleasure.
Yes, now I see the repository... crazy job! Well done
Best regards :)
0
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