Skip to content

[PR] 메인 페이지 시작하기 버튼 수정#70

Merged
TTOCHIwas merged 3 commits intomainfrom
fix#69-main-start-button-fix
Apr 6, 2026
Merged

[PR] 메인 페이지 시작하기 버튼 수정#70
TTOCHIwas merged 3 commits intomainfrom
fix#69-main-start-button-fix

Conversation

@TTOCHIwas
Copy link
Copy Markdown
Collaborator

@TTOCHIwas TTOCHIwas commented Apr 6, 2026

📝 요약 (Summary)

  • 메인 페이지의 시작하기 버튼이 로그인 상태에 따라 각각 로그인 화면마이페이지로 이동하도록 수정
  • 데스크톱 환경에서도 버튼이 줄어들지 않도록 너비를 w="full"로 설정

✅ 주요 변경 사항 (Key Changes)

  • useAuth()를 사용해 메인 CTA의 이동 경로를 각각 /login/mypage로 분기했습니다.
  • 인증 상태 확인 중 잘못된 이동을 방지하기 위해 버튼 비활성화 처리를 추가했습니다.
  • 메인 페이지 시작하기 버튼의 너비를 w="full"로 변경했습니다.

💻 상세 구현 내용 (Implementation Details)

  • 메인페이지에서 useAuth()isAuthenticated, isLoading을 사용하도록 변경했습니다.
  • handleStartClick 내부에서 로그인 상태에 따라 목적 경로를 직접 분기하도록 정리했습니다.
  • 로딩 중에는 disabled_disabled를 사용해서 버튼을 비활성화 처리해줬습니다.

🚀 트러블 슈팅 (Trouble Shooting)

  • 초기 렌더링 시 인증 상태가 동기화가 되지 않은 상태에서 로그인된 사용자가 /login으로 잘못 이동할 수 있었습니다.
    => 이를 방지하기 위해 isLoading 동안 CTA 버튼 상태를 비활성화되도록 처리했습니다.

⚠️ 알려진 이슈 및 참고 사항 (Known Issues & Notes)

  • 다음 이슈에서 메인페이지의 시작하기 버튼 컴포넌트화를 포함한 리펙토링 진행하겠습니다.

📸 스크린샷 (Screenshots)

image image

#️⃣ 관련 이슈 (Related Issues)

@TTOCHIwas TTOCHIwas requested a review from Dobbymin April 6, 2026 08:28
@TTOCHIwas TTOCHIwas self-assigned this Apr 6, 2026
@TTOCHIwas TTOCHIwas added the ✨ Feature 새로운 기능 추가 및 구현하는 경우 label Apr 6, 2026
@TTOCHIwas TTOCHIwas linked an issue Apr 6, 2026 that may be closed by this pull request
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the MainPage to implement authentication-aware navigation for the start button, including a loading state. Feedback suggests leveraging Chakra UI's isDisabled prop to simplify the button's styling and click handling logic, removing the need for manual state checks and custom CSS properties.

Comment on lines +20 to +26
const handleStartClick = () => {
if (isStartButtonDisabled) {
return;
}

navigate(startButtonTargetPath);
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

버튼에 isDisabled 속성을 사용하면 비활성화 상태일 때 클릭 이벤트가 자동으로 차단됩니다. 따라서 핸들러 내부에서 isStartButtonDisabled를 중복으로 체크할 필요가 없으므로 로직을 단순화할 수 있습니다.

  const handleStartClick = () => {
    navigate(startButtonTargetPath);
  };

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

로직 단순화 진행하겠습니다.

Comment on lines +115 to +126
cursor={isStartButtonDisabled ? "not-allowed" : "pointer"}
disabled={isStartButtonDisabled}
fontSize="xl"
fontWeight="bold"
opacity={isStartButtonDisabled ? 0.5 : 1}
p={6}
w={{ base: "full", lg: "auto" }}
w="full"
_active={{ bg: "seed.active" }}
_hover={{ bg: "seed.hover" }}
onClick={() => navigate(ROUTE_PATHS.LOGIN)}
_hover={{
bg: isStartButtonDisabled ? "button.bg" : "seed.hover",
}}
onClick={handleStartClick}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Chakra UI의 Button 컴포넌트는 isDisabled 속성을 제공합니다. 이를 사용하면 cursor, opacity, _hover 상태 등을 수동으로 제어할 필요 없이 일관된 비활성화 스타일과 동작을 자동으로 처리할 수 있습니다. 만약 비활성화 상태에서 특정 커서 모양(예: not-allowed)을 유지하고 싶다면 _disabled 속성을 활용하는 것이 더 권장되는 방식입니다.

Suggested change
cursor={isStartButtonDisabled ? "not-allowed" : "pointer"}
disabled={isStartButtonDisabled}
fontSize="xl"
fontWeight="bold"
opacity={isStartButtonDisabled ? 0.5 : 1}
p={6}
w={{ base: "full", lg: "auto" }}
w="full"
_active={{ bg: "seed.active" }}
_hover={{ bg: "seed.hover" }}
onClick={() => navigate(ROUTE_PATHS.LOGIN)}
_hover={{
bg: isStartButtonDisabled ? "button.bg" : "seed.hover",
}}
onClick={handleStartClick}
fontSize="xl"
fontWeight="bold"
isDisabled={isStartButtonDisabled}
p={6}
w="full"
_active={{ bg: "seed.active" }}
_hover={{ bg: "seed.hover" }}
onClick={handleStartClick}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

확인했습니다. disabled 속성 사용하도록 수정하겠습니다.

@TTOCHIwas TTOCHIwas merged commit 5f25fe2 into main Apr 6, 2026
1 check passed
@TTOCHIwas TTOCHIwas deleted the fix#69-main-start-button-fix branch April 6, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feature 새로운 기능 추가 및 구현하는 경우

Projects

None yet

Development

Successfully merging this pull request may close these issues.

메인 페이지 시작하기 버튼 수정

1 participant