Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 2 years ago

Responsive ecommerce product page - React.js, Tailwind and TypeScript

react, typescript, tailwind-css
MartΓ­nβ€’240
@martinorue
A solution to the E-commerce product page challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Hello, Frontend Mentor community! 😊

In this challenge, I embarked on the journey of using Tailwind and TypeScript, tools that I've recently started diving into πŸš€. My experience with Tailwind was truly gratifying 😊, and I'm excited to continue incorporating it into my projects. As for TypeScript, I have some uncertainties about whether I'm adhering to the best practices, but I've put forth my utmost effort to grasp its concepts πŸ’ͺ. I'm committed to delving deeper into it to extract its full potential.

While I had previously employed Custom Hooks and Context in React for my solution to the Todo app, this time I opted to put them into action once again πŸ› οΈ. For instance, I leveraged Context to efficiently manage the cart πŸ›’. I approached this with a forward-thinking mindset 🧠, envisioning a more 'real-world' application where cart access might be required across various parts of my app.

Concerning the Custom Hooks, I crafted one to handle cart functionalities πŸ›οΈ and another to facilitate the closure of the cart, navigation menu, and product modal by clicking outside πŸš€. My intention was to eliminate redundancy across my codebase, ensuring consistent implementation of these features wherever needed πŸ‘Œ.

Perhaps the most challenging part for me was the implementation of the lightbox or modal, for which I chose to utilize Headless UI. Generally, I'm not a huge fan of employing this kind of libraries, but there are instances where it becomes incredibly convenient . I highly recommend this article on the topic for more insights πŸ“–.

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on MartΓ­n'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

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
Β© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License