Design comparison
Solution retrospective
I'm unable to show the cart count, if you know a simple way to do it, please comment below
Community feedback
- @azick99Posted over 1 year ago
Well-done Fakorede, I like you project!
Here is some advice:
1.In your case it's not hard to make cart count pass count to Navbar through props and create ternary count === 0 ? " " : <span className='cart-count'> {count}</span> and style with position: absolute.
2.To make setCount(count - 1) is not correct because it goes minus like -1, -2 and so on, in order to prevent it use condition in onClick like:
if (count > 0) { setCount(count - 1); }.3.Pay attention to the styles try to make them better as in challenge.
I hope it will be useful for you. Keep coding!!!
Marked as helpful0
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