Skip to content

Conversation

@yj-leee
Copy link
Contributor

@yj-leee yj-leee commented Feb 28, 2025

No description provided.

@netlify
Copy link

netlify bot commented Feb 28, 2025

Deploy Preview for locationcheckgo ready!

Name Link
🔨 Latest commit 441a2ad
🔍 Latest deploy log https://app.netlify.com/sites/locationcheckgo/deploys/67c3ae76b979310008f064da
😎 Deploy Preview https://deploy-preview-16--locationcheckgo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@yj-leee yj-leee marked this pull request as draft February 28, 2025 18:09
@@ -0,0 +1,93 @@
export const UncheckedAllIcon = () => (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ask;

4개의 아이콘을 피그마 svg import를 통해 파일로는 관리할 수 없는 상황이였을까요? 만약 관리할 수 있다면 파일 저장 및 import해서 해당 아이콘을 사용하면 좋을 것 같습니다.

Comment on lines 34 to 36
const [isAllChecked, setIsAllChecked] = useState(false);
const [isTermsChecked, setIsTermsChecked] = useState(false);
const [isPrivacyChecked, setIsPrivacyChecked] = useState(false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p2;

해당 상태들을 객체로 관리하면 좋을 것 같습니다. 지금 handleAllCheck가 호출될 경우 3개의 상태가 업데이트되 3번에 리렌더링이 되어서 렌더링에 있어 보완이 필요할 것 같습니다. 더불어 객체로 관리하면 get 및 set하기가 용이할 것 같습니다. 아래 코드는 참조용 코드입니다.

const [checkState, setCheckState] = useState({
  all: false,
  terms: false,
  privacy: false
});

전체 체크 및 개별 체크 로직

// 전체 체크
const handleAllCheck = () => {
  setCheckState((prev) => {
    const newChecked = !prev.all;
    return {
      all: newChecked,
      terms: newChecked,
      privacy: newChecked
    };
  });
};

// 개별 체크
const handleSingleCheck = (key: 'terms' | 'privacy') => {
  setCheckState((prev) => {
    const newState = {
      ...prev,
      [key]: !prev[key]
    };

    // 모든 체크박스가 체크되면 "all"도 true로 맞춤
    newState.all = newState.terms && newState.privacy;

    return newState;
  });
};

const handleTermsCheck = () => setIsTermsChecked((prev) => !prev);
const handlePrivacyCheck = () => setIsPrivacyChecked((prev) => !prev);

const isNextEnabled = isTermsChecked && isPrivacyChecked;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p2;

객체로 수정하신다면 checkState.all 값이 있기때문에 따로 정의하지 않으셔도 될 것 같습니다.

@yj-leee yj-leee marked this pull request as ready for review March 2, 2025 01:04
@yj-leee yj-leee requested a review from Park-min-hyoung March 2, 2025 01:04
@yj-leee yj-leee self-assigned this Mar 2, 2025
@yj-leee yj-leee merged commit c9a8acd into dev Mar 2, 2025
6 checks passed
@yj-leee yj-leee deleted the feat/auth-agreement branch March 2, 2025 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants