- {/* Order*/}
-
- {/*Payment Details*/}
-
-
-
- {/* Checkout Loading*/}
- {checkoutLoading && (
-
- Behandler ordre, vennligst vent ...
-
-
-
- )}
- {requestError}
+
+ {/* Order*/}
+
+ {/*Payment Details*/}
+
+
-
+ {/* Checkout Loading*/}
+ {checkoutLoading && (
+
+ Behandler ordre, vennligst vent ...
+
+
+
+ )}
+ {requestError}
+
) : (
<>
{orderCompleted && (
diff --git a/components/Checkout/Error.component.jsx b/components/Checkout/Error.component.jsx
deleted file mode 100644
index f5a61ef40..000000000
--- a/components/Checkout/Error.component.jsx
+++ /dev/null
@@ -1,10 +0,0 @@
-const Error = ( { errors, fieldName } ) => {
-
- return(
- errors && ( errors.hasOwnProperty( fieldName ) ) ? (
-
{ errors[fieldName] }
- ) : ''
- )
-};
-
-export default Error;
diff --git a/package-lock.json b/package-lock.json
index b15e7e3ac..46ce807af 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "nextjs-woocommerce",
- "version": "1.0.0",
+ "version": "0.9.8",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/utils/validator/checkoutValidator.js b/utils/validator/checkoutValidator.js
index f2c63b5ed..a33a22435 100644
--- a/utils/validator/checkoutValidator.js
+++ b/utils/validator/checkoutValidator.js
@@ -1,4 +1,9 @@
const validateAndSanitizeCheckoutForm = (data) => {
+
+ console.log(data)
+
+
+
return {
isValid: true,
};
From 3e573084a394de4b3c87b1010cc4b841721daa17 Mon Sep 17 00:00:00 2001
From: w3bdesign <45217974+w3bdesign@users.noreply.github.com>
Date: Tue, 7 Jul 2020 02:50:04 +0200
Subject: [PATCH 2/2] Add React Hook Form to README
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index b0b0ac45f..db5eda9a0 100644
--- a/README.md
+++ b/README.md
@@ -30,6 +30,7 @@
- Cart handling and checkout with WooCommerce (Cash On Delivery only for now)
- Algolia search
- Apollo Client with GraphQL
+- React Hook Form with form validation
- Animations with React-Spring and Animate.css
- Loading spinner created with Styled Components
- Shows page load progress with Nprogress during navigation
@@ -42,7 +43,6 @@
## TODO
- Display product variation name in cart / checkout
-- Implement React-hook-form for validation
- Hide products not in stock
- Add better SEO
- Add a better README.md