Skip to content

Commit

Permalink
feat: 버튼 활성화 부분 로직 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
jiohjung98 committed May 11, 2024
1 parent a65c82d commit f72bfe4
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions src/components/signup/PasswordVerification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -97,7 +101,6 @@ const PasswordVerification = ({ userName, userEmail }: { userName: string; userE
checkFormValidity();
};


const handleNextButtonClick = () => {
// todo
};
Expand Down

0 comments on commit f72bfe4

Please sign in to comment.