Skip to content

Commit

Permalink
Merge pull request #5 from Moaguide-develop/fix/sign
Browse files Browse the repository at this point in the history
fix: lint error
  • Loading branch information
jiohjung98 authored Aug 19, 2024
2 parents c663f5f + 2cb0132 commit 8feadd7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/app/signup/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const SignupPage: React.FC = () => {
});

const handleNext = () => {
console.log('Moving to next step, current formData:', formData);
setCurrentStep((prev) => prev + 1);
};

Expand Down
21 changes: 9 additions & 12 deletions src/components/signup/Step1.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useEffect, useCallback } from 'react';
import React, { useState } from 'react';
import Image from 'next/image';
import PrivacyModal from './modal/PrivacyModal';
import ServiceModal from './modal/ServiceModal';
Expand All @@ -20,30 +20,27 @@ const Step1: React.FC<StepProps> = ({ onNext, onUpdate }) => {
});
const [activePage, setActivePage] = useState<string | null>(null);

const handleUpdate = useCallback(() => {
onUpdate({ marketingConsent: checks.marketing });
console.log('Updated marketingConsent:', checks.marketing);
}, [checks.marketing, onUpdate]);

useEffect(() => {
handleUpdate();
}, [checks.marketing]);

const handleAllCheckedChange = () => {
const newCheckedState = !allChecked;
setAllChecked(newCheckedState);
setChecks({
const newChecks = {
privacy: newCheckedState,
service: newCheckedState,
age: newCheckedState,
marketing: newCheckedState,
});
};
setChecks(newChecks);
onUpdate({ marketingConsent: newCheckedState });
};

const handleCheckChange = (key: string) => {
const newChecks = { ...checks, [key]: !checks[key as keyof typeof checks] };
setChecks(newChecks);
setAllChecked(Object.values(newChecks).every(Boolean));

if (key === 'marketing') {
onUpdate({ marketingConsent: newChecks.marketing });
}
};

const handleArrowClick = (key: string, event: React.MouseEvent) => {
Expand Down

0 comments on commit 8feadd7

Please sign in to comment.