diff --git a/src/components/signup/PasswordVerification.tsx b/src/components/signup/PasswordVerification.tsx index 17aa116..1bf8fb8 100644 --- a/src/components/signup/PasswordVerification.tsx +++ b/src/components/signup/PasswordVerification.tsx @@ -51,35 +51,39 @@ const PasswordVerification = ({ userName, userEmail }: { userName: string; userE const handleServiceTermsCheck = () => { const newServiceTermsCheckIcon = !serviceTermsCheckIcon; setServiceTermsCheckIcon(newServiceTermsCheckIcon); - checkAllAgreed(); - checkFormValidity(); updateAllAgreedIcon(); + if (newServiceTermsCheckIcon && privacyTermsCheckIcon && marketingTermsCheckIcon) { + setAllAgreed(true); + } + else { + setAllAgreed(false); + } }; - + const handlePrivacyTermsCheck = () => { const newPrivacyTermsCheckIcon = !privacyTermsCheckIcon; setPrivacyTermsCheckIcon(newPrivacyTermsCheckIcon); - checkAllAgreed(); - checkFormValidity(); updateAllAgreedIcon(); + if (serviceTermsCheckIcon && newPrivacyTermsCheckIcon && marketingTermsCheckIcon) { + setAllAgreed(true); + } + else { + setAllAgreed(false); + } }; - + const handleMarketingTermsCheck = () => { const newMarketingTermsCheckIcon = !marketingTermsCheckIcon; setMarketingTermsCheckIcon(newMarketingTermsCheckIcon); - checkAllAgreed(); - checkFormValidity(); updateAllAgreedIcon(); - }; - - const checkAllAgreed = () => { - if (serviceTermsCheckIcon && privacyTermsCheckIcon && marketingTermsCheckIcon) { + if (serviceTermsCheckIcon && privacyTermsCheckIcon && newMarketingTermsCheckIcon) { setAllAgreed(true); - } else { + } + else { setAllAgreed(false); } }; - + const updateAllAgreedIcon = () => { if (allAgreed) { setTermsCheckIcon(true); @@ -97,7 +101,6 @@ const PasswordVerification = ({ userName, userEmail }: { userName: string; userE checkFormValidity(); }; - const handleNextButtonClick = () => { // todo };