From 6ac8df7d05cc4ceb696f2bfad14f3b4751322bb6 Mon Sep 17 00:00:00 2001 From: jinhojang6 Date: Sat, 7 Nov 2020 16:38:35 +0900 Subject: [PATCH] Disable submission when T&C is not checked --- src/css/additional-styles/theme.scss | 4 ++++ src/partials/FormTemplate.js | 12 ++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/css/additional-styles/theme.scss b/src/css/additional-styles/theme.scss index e14bb45..db30af4 100644 --- a/src/css/additional-styles/theme.scss +++ b/src/css/additional-styles/theme.scss @@ -30,6 +30,10 @@ button:focus, margin-left: 20px; } +.not-allowed:hover { + cursor: not-allowed; +} + // Hamburger button .hamburger { diff --git a/src/partials/FormTemplate.js b/src/partials/FormTemplate.js index 33902a9..d72f691 100644 --- a/src/partials/FormTemplate.js +++ b/src/partials/FormTemplate.js @@ -66,7 +66,7 @@ const FormTemplate = () => { lastName: '', email: '', emailConfirm: '', - agreed: null, + agreed: [], }} onSubmit={async (values) => { if (values.agreed[0] === 'checked') { @@ -84,7 +84,7 @@ const FormTemplate = () => { }} validate={validate} > - {({ errors, touched, isValidating }) => ( + {({ errors, touched, values }) => (
{/* */} { the Affiliate Program Terms of Service, and the Privacy Policy.

- - + {console.log(values.agreed)} + {values.agreed.length ? ( + + ) : ( + + )} )}