fix: 로그아웃 기능 사이드바 내장 기능으로 구현, 마이페이지및 자유게시판 사이드바 드롭다운 사용, 변경시 성공 토스트 구현#82
Conversation
Summary of ChangesHello @jungwon123, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 PR은 사용자 인터페이스의 일관성과 사용자 경험을 개선하는 데 중점을 둡니다. 사이드바와 모바일 헤더에 로그아웃 및 마이페이지와 같은 핵심 기능을 내장하여 코드 중복을 줄이고 유지보수성을 높였습니다. 또한, 모바일 환경에서의 메뉴 접근성을 향상시키기 위해 Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
로그아웃 기능의 내장화와 사이드바 드롭다운 적용을 통해 전반적인 코드 구조가 깔끔해졌습니다. 특히 마이페이지에서 변경 성공 시 토스트 알림을 추가하여 사용자 경험을 개선한 점이 훌륭합니다. 다만, 공통 컴포넌트(MobileHeader)가 특정 도메인 컴포넌트(TeamSidebarDropdown)에 의존하는 구조는 향후 유지보수와 재사용성 측면에서 위험 요소가 될 수 있습니다. 또한, 여러 컴포넌트에서 동일한 로그아웃 및 이동 로직이 반복되고 있어 이를 공통화할 필요가 있습니다.
| import Image from 'next/image'; | ||
| import clsx from 'clsx'; | ||
| import MobileDrawer from './MobileDrawer'; | ||
| import TeamSidebarDropdown from '@/app/(root)/[teamid]/_domain/components/Team/TeamSidebarDropdown'; |
There was a problem hiding this comment.
코드 수정 완료하여 의존석 역전하였습니다
| isLoggedIn, | ||
| profileImage, | ||
| onMenuClick, | ||
| drawerContent, |
| const defaultLogout = useCallback(async () => { | ||
| await fetch('/api/auth/logout', { method: 'POST' }); | ||
| router.push('/login'); | ||
| }, [router]); | ||
|
|
||
| const handleLogout = onLogout ?? defaultLogout; | ||
| const handleProfileClick = onProfileClick ?? (() => router.push('/mypage')); | ||
| const handleLogoClick = onLogoClick ?? (() => router.push('/addteam')); |
| type="button" | ||
| className={styles.menuButton} | ||
| onClick={onMenuClick} | ||
| onClick={() => setIsDrawerOpen(true)} |
| const defaultLogout = useCallback(async () => { | ||
| await fetch('/api/auth/logout', { method: 'POST' }); | ||
| router.push('/login'); | ||
| }, [router]); | ||
|
|
||
| const handleLogout = onLogout ?? defaultLogout; | ||
| const handleProfileClick = onProfileClick ?? (() => router.push('/mypage')); | ||
| const handleLogoClick = onLogoClick ?? (() => router.push('/addteam')); |
| {successToast && ( | ||
| <Toast | ||
| isOpen | ||
| message={successToast} | ||
| actionLabel="" | ||
| onDismiss={() => setSuccessToast(null)} | ||
| className={styles.toast} | ||
| /> | ||
| )} |
There was a problem hiding this comment.
Code Review
이 PR은 사이드바와 모바일 헤더 컴포넌트의 리팩토링에 중점을 두어 로그아웃, 마이페이지 탐색 및 팀 선택 로직을 캡슐화했습니다. 팀 관련 기능을 위해 TeamSidebarDropdown을 도입하고 MobileDrawer를 MobileHeader에 직접 통합했습니다. 또한, 프로필 이름 및 비밀번호 변경에 대한 성공 토스트 알림을 추가하여 사용자 경험을 개선했습니다. 전반적으로 컴포넌트 재사용성을 높이고 루트 레이아웃을 단순화하여 유지보수성을 향상시키는 잘 구조화된 변경 사항입니다.
Summary
Issue