horoeka-2022 / gardenz

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

Shop: Delivery Form #67

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 first part of our checkout section after the Cart where a user enters in either Delivery or Pickup details.

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 Delivery component and files in the following folder. Create these new files.

client/
├─ views/
│  ├─ users/
│  │  ├─ Gardens/
│  │  │  ├─ Shop/
│  │  │  │  ├─ Delivery/ <-- new
│  │  │  │  │  ├─ Delivery.jsx<-- new
│  │  │  │  │  ├─ delivery.test.js<-- new

Delivery.jsx will render when the user hits the route garden/:id/shop/delivery

You will be getting passed the cart state through props which you will need to send to the next checkout page so it can be sent to orders when completed as well as all the details from the delivery form (like name, etc...). If Cart has not been completed, hardcode this object and any other data you may need.

Inside Delivery.jsx

Your form components will live elsewhere in Subcomponents rather than views.

client/
├─ subcomponent/
│  ├─ Delivery/
│  │  ├─ DeliveryForm.jsx
│  │  ├─ deliveryForm.test.js