Skip to content

fix: 로그아웃 기능 사이드바 내장 기능으로 구현, 마이페이지및 자유게시판 사이드바 드롭다운 사용, 변경시 성공 토스트 구현#82

Merged
jungwon123 merged 2 commits into
mainfrom
feat/boards
Feb 24, 2026
Merged

fix: 로그아웃 기능 사이드바 내장 기능으로 구현, 마이페이지및 자유게시판 사이드바 드롭다운 사용, 변경시 성공 토스트 구현#82
jungwon123 merged 2 commits into
mainfrom
feat/boards

Conversation

@jungwon123

Copy link
Copy Markdown
Contributor

Summary

  • Sidebar/MobileHeader에 기본 로그아웃·마이페이지·로고 핸들러 내장 (prop 미전달 시 자동 동작)
  • MobileHeader에 드로어(TeamSidebarDropdown) 내장 — 모든 페이지에서 모바일 메뉴 자동 동작
  • Root layout에서 TeamSidebarDropdown 재사용으로 코드 간소화, MobileDrawer 제거
  • 마이페이지 이름/비밀번호 변경 성공 시 토스트 알림 추가

Issue

@jungwon123 jungwon123 added this to the 컴포넌트 milestone Feb 24, 2026
@jungwon123 jungwon123 added the 오류수정 오류 및 에러 해결할 때 사용해주세요. label Feb 24, 2026
@github-project-automation github-project-automation Bot moved this to 개발 대기중 in workers Feb 24, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @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은 사용자 인터페이스의 일관성과 사용자 경험을 개선하는 데 중점을 둡니다. 사이드바와 모바일 헤더에 로그아웃 및 마이페이지와 같은 핵심 기능을 내장하여 코드 중복을 줄이고 유지보수성을 높였습니다. 또한, 모바일 환경에서의 메뉴 접근성을 향상시키기 위해 TeamSidebarDropdown을 통합하고, 마이페이지의 이름 및 비밀번호 변경 작업에 대한 명확한 성공 피드백을 제공합니다.

Highlights

  • 사이드바 및 모바일 헤더 기능 내장: 로그아웃, 마이페이지, 로고 핸들러 기능이 사이드바와 모바일 헤더 컴포넌트 내부에 내장되어, prop으로 전달하지 않아도 기본 동작을 수행합니다.
  • 모바일 헤더 드로어 통합: 모바일 헤더에 TeamSidebarDropdown이 드로어 형태로 통합되어, 모든 페이지에서 모바일 메뉴가 자동으로 동작하도록 개선되었습니다.
  • 루트 레이아웃 코드 간소화: 루트 레이아웃에서 TeamSidebarDropdown을 재사용하고 MobileDrawer 컴포넌트를 제거하여 코드가 간소화되었습니다.
  • 마이페이지 변경 성공 토스트 알림: 마이페이지에서 이름 및 비밀번호 변경 성공 시 사용자에게 성공을 알리는 토스트 알림이 추가되었습니다.

🧠 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
  • src/app/(root)/layout.tsx
    • 드로어 상태 관리를 위한 useState 및 관련 import 제거
    • SidebarButton, SidebarTeamSelect, SidebarAddButton, MobileDrawer import 제거
    • TeamSidebarDropdown 컴포넌트 import 추가
    • 사이드바의 teamSelect prop을 TeamSidebarDropdown으로 대체
    • 루트 레이아웃에서 MobileHeaderonMenuClick prop 제거 및 onLogout prop 추가
    • 루트 레이아웃에서 MobileDrawer 컴포넌트 제거
  • src/app/(root)/mypage/page.tsx
    • 성공 메시지를 관리하기 위한 successToast 상태 추가
    • 이름 변경 성공 시 successToast 메시지 설정 로직 추가
    • 비밀번호 변경 성공 시 successToast 메시지 설정 로직 추가
    • 성공 토스트 메시지를 표시하기 위한 Toast 컴포넌트 렌더링 로직 추가
  • src/components/sidebar/MobileHeader.tsx
    • useRouter, useCallback, MobileDrawer, TeamSidebarDropdown import 추가
    • 모바일 드로어 상태 관리를 위한 isDrawerOpen 상태 추가
    • onMenuClick prop을 @deprecated 처리하고 내부 드로어 로직으로 대체
    • 드로어 내부 콘텐츠를 사용자 정의할 수 있는 drawerContent prop 추가
    • 기본 로그아웃, 프로필 클릭, 로고 클릭 핸들러 구현
    • 햄버거 메뉴 버튼 클릭 시 내부 드로어를 열도록 변경
    • 로그아웃, 프로필 클릭, 로고 클릭 이벤트에 기본 핸들러 적용
    • MobileDrawer 컴포넌트를 MobileHeader 내부에 통합하고 TeamSidebarDropdown을 기본 콘텐츠로 설정
  • src/components/sidebar/Sidebar.tsx
    • useRouter, useCallback import 추가
    • 기본 로그아웃, 프로필 클릭, 로고 클릭 핸들러 구현
    • 프로필 메뉴 아이템 및 푸터 클릭 이벤트에 기본 핸들러 적용
    • 로고 클릭 이벤트에 기본 핸들러 적용
Activity
  • 제공된 컨텍스트에 PR 활동 내역이 없습니다.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

로그아웃 기능의 내장화와 사이드바 드롭다운 적용을 통해 전반적인 코드 구조가 깔끔해졌습니다. 특히 마이페이지에서 변경 성공 시 토스트 알림을 추가하여 사용자 경험을 개선한 점이 훌륭합니다. 다만, 공통 컴포넌트(MobileHeader)가 특정 도메인 컴포넌트(TeamSidebarDropdown)에 의존하는 구조는 향후 유지보수와 재사용성 측면에서 위험 요소가 될 수 있습니다. 또한, 여러 컴포넌트에서 동일한 로그아웃 및 이동 로직이 반복되고 있어 이를 공통화할 필요가 있습니다.

Comment thread src/components/sidebar/MobileHeader.tsx Outdated
import Image from 'next/image';
import clsx from 'clsx';
import MobileDrawer from './MobileDrawer';
import TeamSidebarDropdown from '@/app/(root)/[teamid]/_domain/components/Team/TeamSidebarDropdown';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

공통 컴포넌트 폴더(src/components)에 위치한 MobileHeader가 특정 도메인(src/app/(root)/[teamid])의 컴포넌트를 직접 참조하고 있습니다. 이는 컴포넌트 간의 결합도를 높이고 재사용성을 떨어뜨리는 설계입니다. drawerContent의 기본값을 외부(예: layout)에서 주입하거나, 의존성을 역전시킬 수 있는 방법을 고려해 보세요.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

코드 수정 완료하여 의존석 역전하였습니다

isLoggedIn,
profileImage,
onMenuClick,
drawerContent,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

onMenuClickMobileHeaderProps에는 정의되어 있고 주석으로도 호환성을 위해 유지한다고 되어 있으나, 구조 분해 할당에서 누락되었습니다. 이를 추가해야 내부에서 사용할 수 있습니다.

Suggested change
drawerContent,
drawerContent, onMenuClick,

Comment on lines +57 to +64
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'));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

로그아웃 처리 및 페이지 이동 로직이 MobileHeader, Sidebar, layout 세 곳에서 중복되어 정의되어 있습니다. 특히 defaultLogout 로직은 완전히 동일하므로, 이를 별도의 유틸리티 함수나 커스텀 훅으로 분리하여 코드 중복을 제거하고 유지보수성을 높이는 것이 좋습니다.

type="button"
className={styles.menuButton}
onClick={onMenuClick}
onClick={() => setIsDrawerOpen(true)}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

호환성을 위해 onMenuClick이 전달된 경우 드로어를 여는 것과 동시에 해당 콜백을 호출해 주는 것이 좋습니다.

Suggested change
onClick={() => setIsDrawerOpen(true)}
onClick={() => { onMenuClick?.(); setIsDrawerOpen(true); }}

Comment on lines +58 to +65
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'));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

로그아웃 및 이동 핸들러 로직이 MobileHeader와 동일하게 중복 정의되어 있습니다. 공통 로직을 한 곳에서 관리하도록 개선을 권장합니다.

Comment on lines +188 to +196
{successToast && (
<Toast
isOpen
message={successToast}
actionLabel=""
onDismiss={() => setSuccessToast(null)}
className={styles.toast}
/>
)}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

hasChanges에 의한 안내 토스트와 successToast가 동시에 활성화될 경우, 두 토스트가 겹쳐서 보일 수 있습니다. toastWrapper의 CSS가 스택 구조를 지원하지 않는다면, 하나의 토스트 상태 변수를 사용하여 메시지 내용만 교체하는 방식으로 개선하는 것을 추천합니다.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

이 PR은 사이드바와 모바일 헤더 컴포넌트의 리팩토링에 중점을 두어 로그아웃, 마이페이지 탐색 및 팀 선택 로직을 캡슐화했습니다. 팀 관련 기능을 위해 TeamSidebarDropdown을 도입하고 MobileDrawerMobileHeader에 직접 통합했습니다. 또한, 프로필 이름 및 비밀번호 변경에 대한 성공 토스트 알림을 추가하여 사용자 경험을 개선했습니다. 전반적으로 컴포넌트 재사용성을 높이고 루트 레이아웃을 단순화하여 유지보수성을 향상시키는 잘 구조화된 변경 사항입니다.

@jungwon123 jungwon123 merged commit 1e08b04 into main Feb 24, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from 개발 대기중 to 개발 완료 in workers Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

오류수정 오류 및 에러 해결할 때 사용해주세요.

Projects

Status: 개발 완료

Development

Successfully merging this pull request may close these issues.

사이드바 로그아웃 기능 수정, 모바일헤더 컴포넌트 수정

3 participants