Skip to content

정보 수정 페이지 구현#26

Merged
yoouyeon merged 8 commits intodevelopfrom
feat/MD-7
Feb 22, 2026
Merged

정보 수정 페이지 구현#26
yoouyeon merged 8 commits intodevelopfrom
feat/MD-7

Conversation

@yoouyeon
Copy link
Contributor

@yoouyeon yoouyeon commented Feb 21, 2026

#23 에 이어서 작업해서 base branch를 그쪽에 맞춰두었습니다!
머지 전에 develop으로 바꿔둘게요!!

💻 작업 내용

정보 수정 페이지를 구현했습니다

  • 이용 약관 페이지 이동 링크, 회원 탈퇴, 로그아웃 버튼 구현
  • 회원 탈퇴, 로그아웃 api 함수, 훅, msw 핸들러 추가 (아직 api 명세가 없어 변경 가능성 있음)

이용 약관 페이지 버튼은 구현했는데, 저희가 아직 이용 약관 페이지 관련해서는 얘기를 해 본적이 없는 것 같아서 우선은 구현만 해두고 주석처리 해두었습니다!

📸 스크린샷

이용 약관 버튼 있음 이용 약관 버튼 없음
localhost_3000_my_edit(iPhone 14 Pro Max) localhost_3000_my_edit(iPhone 14 Pro Max) (1)

👻 리뷰 요구사항

개발하다보니 예전에 나름대로 정리했던 디렉토리 구조나 코드 구조가 여전히 좀 뒤죽박죽인 느낌이 들었습니다... (함수/변수 네이밍이나 api 함수 구조 등등...)
readme에 정리해뒀던 디렉토리 구조도 수정할 겸 다시 코드나 디렉토리 구조 일관성 부분을 확인해보면 좋겠다는 생각이 들어서,
남은 기능 개발하면서 좀 고민해보다가 나중에 여유 생기면 한번 살펴봐도 좋을 것 같습니다!

Summary by CodeRabbit

릴리스 노트

  • New Features

    • 로그아웃 기능 추가
    • 회원 탈퇴 기능 추가
  • UI Improvements

    • 내 정보 편집 페이지에 네비게이션 헤더 및 로그아웃·회원 탈퇴 버튼 추가
    • 이용약관 링크 컴포넌트 추가
    • 구분선(Divider)이 표준 HTML 속성(예: 이벤트, 속성 전달)을 지원하도록 개선
  • Chores

    • 로그아웃·회원 탈퇴 동작에 대한 모의(API mock) 엔드포인트 추가

@yoouyeon yoouyeon self-assigned this Feb 21, 2026
@yoouyeon yoouyeon added the ✨ Feature 신규 기능 추가 label Feb 21, 2026
@github-actions
Copy link

github-actions bot commented Feb 21, 2026

📝 관련 이슈

MD-7

@github-actions github-actions bot requested a review from ongheong February 21, 2026 13:50
@yoouyeon
Copy link
Contributor Author

@coderabbitai full review

@coderabbitai
Copy link

coderabbitai bot commented Feb 21, 2026

✅ Actions performed

Full review triggered.

@coderabbitai
Copy link

coderabbitai bot commented Feb 21, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

로그아웃 및 회원탈퇴 기능이 추가되었습니다. API 헬퍼와 React Query 훅, 관련 UI 컴포넌트 및 MSW 모의 핸들러가 추가되었고 MyEditPage가 해당 버튼들과 함께 갱신되었으며 Divider 컴포넌트가 HTML 속성 전달을 허용하도록 변경되었습니다.

Changes

Cohort / File(s) Summary
Auth API
src/features/auth/api/authApi.ts
logout(POST /user/logout) 및 unregister(DELETE /users/me) API helpers 추가(공유 axios 인스턴스 사용, useMock: true).
Auth Hooks
src/features/auth/api/useLogout.ts, src/features/auth/api/useUnregister.ts
React Query의 mutation 훅 추가. 성공 시 쿼리 캐시 초기화 및 ROUTE.login으로 네비게이션 수행 — 네비게이션/캐시 동작 주의.
Auth UI Components
src/features/auth/ui/LogoutButton/index.tsx, src/features/auth/ui/LogoutButton/index.styles.ts, src/features/auth/ui/UnregisterButton/index.tsx, src/features/auth/ui/UnregisterButton/index.styles.ts
LogoutButton·UnregisterButton 컴포넌트 및 스타일 추가. 훅 호출, 로딩 상태에 따른 비활성화·문구 전환 적용. 스타일은 theme 기반.
Auth Exports
src/features/auth/index.ts
LogoutButton, UnregisterButton를 모듈 레벨에서 재내보내기 추가.
MyEdit Page & TermsLink
src/pages/my-edit/MyEditPage.tsx, src/pages/my-edit/ui/TermsLink/index.tsx, src/pages/my-edit/ui/TermsLink/index.styles.ts, src/pages/my-edit/ui/index.ts
MyEditPage에 헤더·Divider·Unregister/Logout 버튼 추가. TermsLink 컴포넌트와 스타일 및 해당 UI 인덱스 재수출 추가(클릭 시 기본 이동 방지, TODO 네비게이션).
Shared Divider
src/shared/ui/Divider/index.tsx
DividerPropsHTMLAttributes<HTMLDivElement>를 확장하도록 변경. 외부 래퍼 제거하고 S.Divider에 추가 HTML 속성 및 이벤트를 직접 전달하도록 수정 — 사용처의 props 전달 영향 확인 필요.
Mock Handlers
src/mocks/handlers/auth.ts
MSW 엔드포인트 추가: POST /api/v1/user/logout, DELETE /api/v1/users/me. X-Mock-Request: 'true' 검사 후 204 응답 반환.

Poem

🐰 나는 작은 토끼, 버튼을 눌러요 —
로그아웃은 살포시, 탈퇴는 조심스레.
훅들이 뒷정리하고, 모의 서버는 졸며,
MyEditPage에 새 친구들이 모였네. 🌱✨

🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/MD-7

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (2)
src/pages/my-edit/ui/TermsLink/index.styles.ts (1)

4-7: display: block (혹은 inline-block) 추가 고려

styled.a의 기본 display는 inline이므로, padding-top/padding-bottom이 주변 콘텐츠의 흐름에 영향을 주지 않을 수 있습니다. LogoutButton/UnregisterButton에서 사용하는 styled.button은 기본이 inline-block이라 수직 패딩이 올바르게 동작하는 반면, <a>는 그렇지 않습니다.

♻️ 제안된 수정
 export const Link = styled.a`
   padding: ${({ theme }) => `${theme.unit[12]} ${theme.unit[20]}`};
+  display: block;
   ${TextVariant('body1R')};
 `;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pages/my-edit/ui/TermsLink/index.styles.ts` around lines 4 - 7, The Link
styled component (export const Link = styled.a) uses default inline display so
vertical padding may not take effect; update the Link styles to include display:
inline-block (or display: block if full-width behavior is desired) so
padding-top/padding-bottom are applied consistently like the
LogoutButton/UnregisterButton; keep the existing padding and
TextVariant('body1R') but add the display rule to the component.
src/features/auth/api/useUnregister.ts (1)

6-17: useLogoutonSuccess 로직이 동일합니다 — 선택적으로 공통 유틸 추출을 고려해볼 수 있습니다.

useLogoutuseUnregister 모두 onSuccess에서 queryClient.clear()navigate(ROUTE.login) 순서로 동일한 로직을 수행합니다. 현재 파일 수가 적어 중복이 크지 않지만, 향후 인증 관련 mutation이 늘어날 경우 공통 헬퍼(예: handleAuthSuccess)로 추출하면 유지보수가 용이해집니다.

♻️ 공통 헬퍼 추출 예시
// src/features/auth/api/authUtils.ts (신규 파일)
+import { QueryClient } from '@tanstack/react-query';
+import { NavigateFunction } from 'react-router';
+import { ROUTE } from '@/shared/config/route';
+
+export const clearAuthAndRedirect = (
+  queryClient: QueryClient,
+  navigate: NavigateFunction,
+) => {
+  queryClient.clear();
+  navigate(ROUTE.login);
+};
// useUnregister.ts
 onSuccess: () => {
-  queryClient.clear();
-  navigate(ROUTE.login);
+  clearAuthAndRedirect(queryClient, navigate);
 },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/features/auth/api/useUnregister.ts` around lines 6 - 17, Both
useUnregister and useLogout duplicate the same onSuccess behavior (calling
queryClient.clear() then navigate(ROUTE.login)); extract that shared logic into
a small helper (e.g., handleAuthSuccess) and call it from both mutation
onSuccess handlers. Locate the useUnregister and useLogout hooks, move the
sequence queryClient.clear() + navigate(ROUTE.login) into the helper and have
each hook invoke handleAuthSuccess(queryClient, navigate) or similar so the
onSuccess bodies become a single call.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/features/auth/api/useLogout.ts`:
- Around line 12-15: The logout handler in useLogout (onSuccess) calls
navigate(ROUTE.login) which pushes a new history entry; change it to
navigate(ROUTE.login, { replace: true }) so the login page replaces the current
history entry to prevent back-navigation to authenticated pages; apply the same
change in the useUnregister hook where navigate(ROUTE.login) is used, leaving
queryClient.clear() intact.

In `@src/features/auth/ui/UnregisterButton/index.tsx`:
- Around line 7-11: Wrap the immediate call to unregister() behind a user
confirmation step: replace the inline onClick={() => unregister()} on S.Button
in the UnregisterButton component with an onClick handler that opens a
confirmation dialog/modal (or uses window.confirm) and only calls unregister()
if the user explicitly confirms; ensure isPending still disables the button and
shows '탈퇴 중...' while the API runs, and keep the existing unregister() call and
error/cleanup handling unchanged. Use or create a local state like isConfirmOpen
or a reusable ConfirmDialog component to present the confirmation UI so
accidental clicks do not trigger immediate account deletion.

In `@src/pages/my-edit/ui/TermsLink/index.tsx`:
- Line 5: The anchor currently uses an empty href which navigates to the root;
update TermsLink (S.Link in src/pages/my-edit/ui/TermsLink/index.tsx) to prevent
unintended navigation by removing the empty href (omit href or set it to
undefined) and instead handle clicks via an onClick handler or use role="button"
with aria-disabled when the terms page is not implemented; ensure any onClick
calls event.preventDefault() if you keep an href-like element and add
appropriate accessibility attributes (aria-disabled) so the link is
non-navigable until the real terms route/component (or router Link) is
available.

In `@src/shared/ui/Divider/index.tsx`:
- Around line 1-8: The file uses the React namespace type React.HTMLAttributes
in the DividerProps interface but doesn't import React, causing a TS error; fix
by adding a named import from 'react' (import { HTMLAttributes } from 'react')
and update DividerProps to extend HTMLAttributes<HTMLDivElement> (or
alternatively import React as a namespace), so update the DividerProps and keep
the Divider function signature as-is to use the imported type.

---

Nitpick comments:
In `@src/features/auth/api/useUnregister.ts`:
- Around line 6-17: Both useUnregister and useLogout duplicate the same
onSuccess behavior (calling queryClient.clear() then navigate(ROUTE.login));
extract that shared logic into a small helper (e.g., handleAuthSuccess) and call
it from both mutation onSuccess handlers. Locate the useUnregister and useLogout
hooks, move the sequence queryClient.clear() + navigate(ROUTE.login) into the
helper and have each hook invoke handleAuthSuccess(queryClient, navigate) or
similar so the onSuccess bodies become a single call.

In `@src/pages/my-edit/ui/TermsLink/index.styles.ts`:
- Around line 4-7: The Link styled component (export const Link = styled.a) uses
default inline display so vertical padding may not take effect; update the Link
styles to include display: inline-block (or display: block if full-width
behavior is desired) so padding-top/padding-bottom are applied consistently like
the LogoutButton/UnregisterButton; keep the existing padding and
TextVariant('body1R') but add the display rule to the component.

@yoouyeon
Copy link
Contributor Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Feb 21, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@yoouyeon
Copy link
Contributor Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Feb 21, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@ongheong ongheong left a comment

Choose a reason for hiding this comment

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

👍🏻👍🏻👍🏻

Base automatically changed from feat/MD-5 to develop February 22, 2026 13:41
@yoouyeon
Copy link
Contributor Author

@coderabbitai approve

@coderabbitai
Copy link

coderabbitai bot commented Feb 22, 2026

✅ Actions performed

Comments resolved and changes approved.

@yoouyeon yoouyeon merged commit 1836f90 into develop Feb 22, 2026
1 check passed
@yoouyeon yoouyeon deleted the feat/MD-7 branch February 22, 2026 13:59
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.

2 participants