From a3e30d6cc884faebba901d91259d2851af3e58d0 Mon Sep 17 00:00:00 2001 From: tomasmaranga Date: Wed, 23 Apr 2025 17:52:56 -0400 Subject: [PATCH 1/2] Completed --- src/components/SignUp.tsx | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/components/SignUp.tsx b/src/components/SignUp.tsx index 7fe1828..ebef55d 100644 --- a/src/components/SignUp.tsx +++ b/src/components/SignUp.tsx @@ -171,12 +171,20 @@ export default function SignUp() { return true; }; + const validateOver14 = () => { + if (!isOverAge14) { + return false; + } + return true; + }; + const validateForm = () => { const isEmailValid = validateEmail(); const isPasswordValid = validatePassword(); const isZipValid = validateZip(); + const isOver14Valid = validateOver14(); - if (!isEmailValid || !isPasswordValid || !isZipValid) { + if (!isEmailValid || !isPasswordValid || !isZipValid || !isOver14Valid) { return false; } @@ -467,7 +475,13 @@ export default function SignUp() { Are you 14 or over?
*
-
+
Note: we require volunteers to be at least 14 to work with us.
@@ -688,7 +702,7 @@ export default function SignUp() { ) : ( From 17765471c2b99a19dc4203d2d21b66d2ad817266 Mon Sep 17 00:00:00 2001 From: wkim10 Date: Sat, 26 Apr 2025 22:49:05 -0400 Subject: [PATCH 2/2] small change to logic --- src/components/SignUp.tsx | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/components/SignUp.tsx b/src/components/SignUp.tsx index ebef55d..fb670eb 100644 --- a/src/components/SignUp.tsx +++ b/src/components/SignUp.tsx @@ -171,18 +171,11 @@ export default function SignUp() { return true; }; - const validateOver14 = () => { - if (!isOverAge14) { - return false; - } - return true; - }; - const validateForm = () => { const isEmailValid = validateEmail(); const isPasswordValid = validatePassword(); const isZipValid = validateZip(); - const isOver14Valid = validateOver14(); + const isOver14Valid = isOverAge14 === true; if (!isEmailValid || !isPasswordValid || !isZipValid || !isOver14Valid) { return false;