From 2943168803a1d5f1359934e78c3e11437882d28b Mon Sep 17 00:00:00 2001 From: Loan Laux Date: Thu, 5 Aug 2021 19:01:24 +0200 Subject: [PATCH] add useAddShippingAddress hook + add phone and region fields in address Signed-off-by: Loan Laux --- .../PaymentMethodView/PaymentMethodView.tsx | 15 ++- .../checkout/ShippingView/ShippingView.tsx | 48 +++++++-- components/ui/context.tsx | 7 +- .../cart/use-add-shipping-address.tsx | 20 ++++ framework/commerce/index.tsx | 1 + framework/commerce/types/cart.ts | 23 +++++ .../api/endpoints/cart/add-item.ts | 17 ++-- .../cart/use-add-shipping-address.tsx | 97 +++++++++++++++++++ framework/reactioncommerce/provider.ts | 9 +- .../reactioncommerce/utils/mutations/index.ts | 1 + .../mutations/set-shipping-address-on-cart.ts | 13 +++ 11 files changed, 229 insertions(+), 22 deletions(-) create mode 100644 framework/commerce/cart/use-add-shipping-address.tsx create mode 100644 framework/reactioncommerce/cart/use-add-shipping-address.tsx create mode 100644 framework/reactioncommerce/utils/mutations/set-shipping-address-on-cart.ts diff --git a/components/checkout/PaymentMethodView/PaymentMethodView.tsx b/components/checkout/PaymentMethodView/PaymentMethodView.tsx index 873371add..ebf558fec 100644 --- a/components/checkout/PaymentMethodView/PaymentMethodView.tsx +++ b/components/checkout/PaymentMethodView/PaymentMethodView.tsx @@ -144,12 +144,21 @@ const PaymentMethodView: FC = () => {
- + + +
+
+ +
{
- + + +
+
+