shopping cart using React js and styled components
Design comparison
Solution retrospective
Thank God I'm finally done after a week of coding and debugging. I still have some problems I'll like to share with this lovely community for help: #1. how to add windows listener to react components #2. How to code a responsive modal in react.
thank you in advance for your comments.
Community feedback
- @karthik2265Posted over 2 years ago
looks good
The lightbox looks great, you should definitely put more effort into css. If you want to take your css to next level try scrimba.com, they have awesome free courses.
I found this repo to be very helpful as a resource (react), take a look https://github.com/academind/react-complete-guide-code
Overall, well done 👏
Aim for improvement, not perfection.
Thank you
1@Clemcy9Posted over 2 years ago@karthik2265 thank you very much, I'll take a look at it sir
1 - @shihabmunshi06Posted over 2 years ago
This comment was deleted over 2 years ago
0@Clemcy9Posted over 2 years ago@shihabmunshi06 thanks for the comment. Yes I understatnd this solution, but what I really need is adding an onclick listener generally to window object to help toggle off nav-menu and cart modal. If I choose to follow the solution you stated, I'll have to add this listener to every component individually... very stressful and I think it will make my code 'wet'
0@shihabmunshi06Posted over 2 years ago@Clemcy9 I didn't clearly understand what you wanted, you want the mobile menu to close when the user clicks/touches on the document outside nav ??
0@shihabmunshi06Posted over 2 years ago@Clemcy9 i do that with javascript, where i select all the things with != nav, whenever someone clicks outside nav, i take away the active class and the nav shrinks
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