horoeka-2022 / gardenz

Empowering community gardens in New Zealand
0 stars 1 forks source link

Shop: Cart #56

Open clementine-smart opened 1 year ago

clementine-smart commented 1 year ago

This is part of a much larger feature of implementing an ecommerce shop and then managing orders for each garden in both Users and Admin. This is the second ticket of the User's Shop front. The shop is issue ##, the cart and then checkout!

Checkout the Figma wireframes so you can see exactly what you are building. If you have any questions after reading the ticket please make sure you have asked for questions before starting!!

We need to make the shop component and files in the following folder. Create these new files.

client/
├─ views/
│  ├─ users/
│  │  ├─ Gardens/
│  │  │  ├─ Shop/
│  │  │  │  ├─ Cart/ <-- new
│  │  │  │  │  ├─ Cart.jsx <-- new
│  │  │  │  │  ├─ cart.test.js<-- new
│  │  │  │  │  ├─ cartHelper.js <-- new

Cart.jsx will render when the user hits the route /gardens/:id/shop/cart

You will be getting passed the cart state through props. If the shop has not been created please hardcode a props.cart object with the products in an array.

You will need a singular cart item component which will be stored elsewhere in subcomponents.

client/
├─ subcomponents/
│  ├─ Cart/
│  │  ├─ CartItem.jsx <-- new
│  │  ├─ cartHelper.js <-- new