Responsive E-commerce site using Next.j, Tailwind CSS,
Design comparison
Solution retrospective
I'm most proud of the dynamic rendering of products and data, ensuring a seamless experience across devices with a responsive design that closely adheres to the original vision. On top of that, the custom loading animation I created sort of adds a refined, professional feel during data fetching.
What challenges did you encounter, and how did you overcome them?One of the main challenges I encountered was implementing the shopping cart functionality, especially when managing state and local storage. Since I’m still learning, figuring out how to properly add and remove items from the cart, update quantities, and ensure everything persisted in local storage was a bit tricky. I overcame this by breaking the problem down into smaller steps, first by focusing on managing state locally, then gradually connecting it with local storage and making sure everything was synced. Through trial and error, and ChatGPT lol, I learned more about managing state in React and how to handle side effects like updating local storage.
What specific areas of your project would you like help with?I need assistance improving my cart system, particularly with:
Syncing with Local Storage: I'm struggling to ensure the cart stays fully synced when items are removed, especially when clearing all items at once.
State Management: I'm using useSWR, but I'm not sure if it's the best approach or if something like Redux would be more effective.
Error Handling: I’d like advice on managing edge cases, such as empty cart states or updating item quantities, especially to ensure the quantity of an item updates correctly when selected multiple times.
Community feedback
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