Design comparison
Solution retrospective
Not the best code I've written , both react and scss, you can checkout my github readme for more explanation . . . anyways there are some issues I would gladly feel happy to be helped with.. like resetting the state of my cart checkout when delete btn is clicked , or my css as well . . . anyways cheers π₯π₯
Community feedback
- @Yup03Posted 12 months ago
Great Challenge @kabir-afk
At first sight, contribution i can make is that when one click on the button after invoking
addToCart
, It will be a good behavior to set backnumberOfItems
to0
like the following:<button className="addToCart" onClick={() => { props.addToCart({ numberOfItems }) setNumberOfItems(0) }} >
0@kabir-afkPosted 12 months ago@Yup03 I forgot what I wrote π π . . . but I'll definately look into itπ
0 - Account deleted
To be able to delete the products from the cart for each button of the product, you can add an attribute that will have a unique number as its value. You will select the button after the index and then you will implement the product deletion function.
0@kabir-afkPosted about 1 year ago@Creciun-Dorin can you pls elebaorate it with context to the code i've written or in a way that is relatable to the app...thank you
0
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