E-commerce product page | Next.js | Tailwind

Solution retrospective
I created a function handleClickoutside that closes cart tooltip and mobile navbar when you click outside of those boxes. I learned about .closest()
method on HTML elements and how it can be used for this purpouse.
Making components reusable like I tried to make the button component resusable but, the onClick function I needed to pass , needed two arguemnts, so I thought I needed to pass arguments as well.
But then I realized that my styling wrapper should just be a div and I should pass the button as children with onClick and function arguments. Not sure if this is the best approach.
What specific areas of your project would you like help with?React side of things. I used hard codes values alot,
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on huzaifanur's solution.
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