From fc6fbbd1f668c07108faddf8ccc64c883a83db65 Mon Sep 17 00:00:00 2001 From: AEU Date: Tue, 24 Feb 2026 20:03:22 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=20[refactor]=20=EC=82=AC=EC=9D=B4=EB=93=9C?= =?UTF-8?q?=EB=B0=94=20=EC=84=A0=ED=83=9D=EB=90=9C=20=EB=A9=94=EB=89=B4=20?= =?UTF-8?q?=EA=B0=95=EC=A1=B0=20=ED=91=9C=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/shared/components/SidebarDrawer.tsx | 60 ++++++++++++++----------- 1 file changed, 34 insertions(+), 26 deletions(-) diff --git a/src/shared/components/SidebarDrawer.tsx b/src/shared/components/SidebarDrawer.tsx index e8a5a700..2ef07b1a 100644 --- a/src/shared/components/SidebarDrawer.tsx +++ b/src/shared/components/SidebarDrawer.tsx @@ -1,11 +1,12 @@ import { useEffect, useState, useContext } from 'react'; -import { Link, useNavigate } from 'react-router-dom'; +import { NavLink, useNavigate } from 'react-router-dom'; import ConfirmLogoutModal from '@features/user/components/ConfirmLogoutModal.tsx'; import { getMe } from '@features/user/api/user.api.ts'; import { logout } from '@features/auth/api/auth.api.ts'; import { userDefaultImage } from '@/const.ts'; import { AuthContext } from '@/AuthContext.ts'; import { useAuthedClient } from '@shared/hooks/useAuthClient.ts'; +import cn from '@/lib/utils/cn'; type Props = { open: boolean; @@ -29,7 +30,6 @@ export default function SidebarDrawer({ open, onClose }: Props) { const client = useAuthedClient(); useEffect(() => { - // 드로어가 열려 있을 때만 불러와도 되고, 한 번만 불러와도 됨 getMe(client) .then((data) => { const userData = data as { @@ -46,7 +46,6 @@ export default function SidebarDrawer({ open, onClose }: Props) { }) .catch((err) => { console.error('SidebarDrawer getMe 실패:', err); - // 실패해도 UI는 기본 아바타 + 빈 텍스트로 표시 setUser({ nickname: '', email: '', @@ -55,7 +54,6 @@ export default function SidebarDrawer({ open, onClose }: Props) { }); }, [client]); - // MyPage에서 브로드캐스트한 프로필 변경 이벤트 수신 useEffect(() => { const handler = (e: Event) => { const custom = e as CustomEvent; @@ -76,18 +74,14 @@ export default function SidebarDrawer({ open, onClose }: Props) { return ( <> - {/* 드로어 패널 */} - {/* 로그아웃 확인 모달 */} setConfirmOpen(false)} onConfirm={async () => { setConfirmOpen(false); try { - // 실제 로그아웃 API + sessionStorage 토큰 삭제 await logout(client); } catch (error) { console.error('로그아웃 API 호출 실패:', error); } finally { - // 재인증 시간 등 추가 상태도 정리 localStorage.removeItem('reauthAt'); clearToken(); - // 드로어 닫고 로그인 페이지로 이동 onClose(); navigate('/login', { replace: true }); } From c44f8d895f4bc7b7987fc19cdd842b229d36a3f4 Mon Sep 17 00:00:00 2001 From: AEU Date: Tue, 24 Feb 2026 20:17:39 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=20[docs]=20=EC=A3=BC=EC=84=9D=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/shared/components/SidebarDrawer.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/shared/components/SidebarDrawer.tsx b/src/shared/components/SidebarDrawer.tsx index 2ef07b1a..03549088 100644 --- a/src/shared/components/SidebarDrawer.tsx +++ b/src/shared/components/SidebarDrawer.tsx @@ -184,7 +184,6 @@ export default function SidebarDrawer({ open, onClose }: Props) { - {/* 하단 사용자 카드 */}