@azick99
Posted
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 helpful