From 9d5fc56c9b843f48873b17167006fa2250d74834 Mon Sep 17 00:00:00 2001 From: minjaehan Date: Mon, 3 Nov 2025 23:48:23 +0900 Subject: [PATCH] =?UTF-8?q?fix:=EC=84=B8=EB=B6=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SettingsDropdown/settingsData.ts | 66 ++++++++++++------- 1 file changed, 41 insertions(+), 25 deletions(-) diff --git a/src/pages/settings/components/SettingsDropdown/settingsData.ts b/src/pages/settings/components/SettingsDropdown/settingsData.ts index c1e8104..b5b4264 100644 --- a/src/pages/settings/components/SettingsDropdown/settingsData.ts +++ b/src/pages/settings/components/SettingsDropdown/settingsData.ts @@ -36,36 +36,52 @@ export const getSettingsData = ({ navigate, loginMethod, handleLogout }: GetSett { label: '이메일 변경', path: '/settings/email' }, ], }); + sections.push({ + category: '기타', + items: [ + { label: '정보 동의 설정' }, + { label: '회원 탈퇴', path: '/settings/delete' }, + { + label: '로그아웃', + onClick: handleLogout + ? () => { + void handleLogout(); + } + : () => { + void (async () => { + // 폴백: handleLogout이 전달되지 않은 경우 + localStorage.removeItem('accessToken'); + localStorage.removeItem(LOGIN_METHOD_STORAGE_KEY); + void navigate('/'); + })(); + }, + }, + ], + }); } else { - const providerLabel = loginMethod === 'kakao' ? '카카오' : loginMethod === 'google' ? 'Google' : '소셜 로그인'; sections.push({ category: '계정', - items: [{ label: `${providerLabel} 계정으로 로그인 중이에요.`, kind: 'info' }], + items: [ + { label: '정보 동의 설정' }, + { label: '회원 탈퇴', path: '/settings/delete' }, + { + label: '로그아웃', + onClick: handleLogout + ? () => { + void handleLogout(); + } + : () => { + void (async () => { + // 폴백: handleLogout이 전달되지 않은 경우 + localStorage.removeItem('accessToken'); + localStorage.removeItem(LOGIN_METHOD_STORAGE_KEY); + void navigate('/'); + })(); + }, + }, + ], }); } - sections.push({ - category: '기타', - items: [ - { label: '정보 동의 설정' }, - { label: '회원 탈퇴', path: '/settings/delete' }, - { - label: '로그아웃', - onClick: handleLogout - ? () => { - void handleLogout(); - } - : () => { - void (async () => { - // 폴백: handleLogout이 전달되지 않은 경우 - localStorage.removeItem('accessToken'); - localStorage.removeItem(LOGIN_METHOD_STORAGE_KEY); - void navigate('/'); - })(); - }, - }, - ], - }); - return sections; };