Skip to content

Conversation

@minimo-9
Copy link
Contributor

@minimo-9 minimo-9 commented Aug 2, 2025

📌 변경 사항 개요

알림 컴포넌트 구현, 헤더에 알림 추가, 로그아웃 기능 수정

📝 상세 내용

체험 예약을 승인, 거절 시 나오는 알림창 구현
실시간 처럼 보이기 위해 10초마다 자동으로 api를 불러옴
로그아웃에 토큰이 안 지워지던 부분을 수정

🔗 관련 이슈

🖼️ 스크린샷(선택사항)

데스크탑, 태블릿
image
모바일
image

💡 참고 사항

Summary by CodeRabbit

  • 신규 기능

    • 알림 드롭다운, 알림 카드, 알림 카드 리스트 컴포넌트가 추가되어 알림 목록 및 무한 스크롤, 알림 삭제 기능을 제공합니다.
    • 알림 관련 API 연동 및 커스텀 훅 추가로 실시간 알림 조회 및 삭제가 가능합니다.
    • 로그아웃 기능이 비동기로 개선되고, 실패 시 에러 메시지가 표시됩니다.
  • 버그 수정/스타일

    • 로그인 및 회원가입 폼의 중간 화면 상단 여백이 조정되었습니다.
    • 로딩 컴포넌트의 최소 높이 제한이 제거되었습니다.
  • 문서화 및 타입

    • 알림 데이터 타입 및 파라미터 인터페이스가 추가되었습니다.
    • 상대 시간 표시 유틸리티가 도입되어 알림 생성 시간이 "몇 분 전" 등으로 표시됩니다.

@minimo-9 minimo-9 self-assigned this Aug 2, 2025
@minimo-9 minimo-9 added the ✨ Feature 기능구현 label Aug 2, 2025
@minimo-9 minimo-9 linked an issue Aug 2, 2025 that may be closed by this pull request
@minimo-9 minimo-9 added the 🔨 Refactor 코드 리팩토링 label Aug 2, 2025
@coderabbitai
Copy link

coderabbitai bot commented Aug 2, 2025

Warning

Rate limit exceeded

@minimo-9 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 7 minutes and 1 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between b79f27a and 777238b.

📒 Files selected for processing (14)
  • src/app/(non-header)/login/components/LoginForm.tsx (1 hunks)
  • src/app/(non-header)/signup/components/SignupForm.tsx (1 hunks)
  • src/app/api/my-notifications/[notificationId]/route.ts (1 hunks)
  • src/app/api/my-notifications/route.ts (1 hunks)
  • src/components/Header.tsx (2 hunks)
  • src/components/Loading.tsx (1 hunks)
  • src/components/Notification/NotificationCard.tsx (1 hunks)
  • src/components/Notification/NotificationCardList.tsx (1 hunks)
  • src/components/Notification/NotificationDropdown.tsx (1 hunks)
  • src/hooks/useDeleteNotification.ts (1 hunks)
  • src/hooks/useLogout.ts (1 hunks)
  • src/hooks/useNotification.ts (1 hunks)
  • src/types/notificationType.ts (1 hunks)
  • src/utils/relativeTime.ts (1 hunks)

Walkthrough

알림 기능이 대폭 추가 및 개선되었습니다. 신규 알림 API 라우트와 관련 커스텀 훅, 타입, 유틸 함수, 그리고 알림 드롭다운 및 카드 UI 컴포넌트가 도입되었습니다. 로그인/회원가입/로딩 컴포넌트의 마진 및 레이아웃도 일부 수정되었습니다. Header 컴포넌트는 알림 드롭다운 연동과 비동기 로그아웃 처리로 업데이트되었습니다.

Changes

Cohort / File(s) Change Summary
알림 API 라우트 추가/수정
src/app/api/my-notifications/route.ts, src/app/api/my-notifications/[notificationId]/route.ts
/api/my-notifications GET 및 /api/my-notifications/[notificationId] DELETE 라우트 신설, 인증 및 에러 처리 포함
알림 커스텀 훅 및 타입
src/hooks/useNotification.ts, src/hooks/useDeleteNotification.ts, src/types/notificationType.ts
알림 목록 조회/삭제용 커스텀 훅, 알림 관련 타입 인터페이스 추가
알림 UI 컴포넌트
src/components/Notification/NotificationDropdown.tsx,
src/components/Notification/NotificationCard.tsx,
src/components/Notification/NotificationCardList.tsx
알림 드롭다운, 알림 카드, 알림 카드 리스트 컴포넌트 신규 도입, 무한 스크롤 및 개별 삭제 지원
Header 개선
src/components/Header.tsx, src/hooks/useLogout.ts
Header에 알림 드롭다운 연동, 비동기 로그아웃 처리 및 에러 핸들링 추가
유틸 함수
src/utils/relativeTime.ts
날짜를 한국어 상대시간 문자열로 변환하는 유틸 함수 추가
폼/로딩 UI 마진 조정
src/app/(non-header)/login/components/LoginForm.tsx,
src/app/(non-header)/signup/components/SignupForm.tsx,
src/components/Loading.tsx
로그인/회원가입 폼 및 로딩 컴포넌트의 마진, 높이 등 레이아웃 일부 수정

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Header
    participant NotificationDropdown
    participant NotificationCardList
    participant API as /api/my-notifications
    participant useNotification

    User->>Header: 알림 아이콘 클릭
    Header->>NotificationDropdown: 드롭다운 열기
    NotificationDropdown->>useNotification: 알림 목록 fetch
    useNotification->>API: GET /api/my-notifications
    API-->>useNotification: 알림 데이터 반환
    useNotification-->>NotificationDropdown: 알림 데이터 전달
    NotificationDropdown->>NotificationCardList: 알림 목록 렌더링
    User->>NotificationDropdown: 닫기 버튼 클릭
    NotificationDropdown->>Header: onClose 콜백 실행
Loading
sequenceDiagram
    participant User
    participant NotificationCard
    participant useDeleteNotification
    participant API as /api/my-notifications/[notificationId]

    User->>NotificationCard: 삭제 버튼 클릭
    NotificationCard->>useDeleteNotification: mutate(notificationId)
    useDeleteNotification->>API: DELETE /api/my-notifications/[notificationId]
    API-->>useDeleteNotification: 204 No Content
    useDeleteNotification-->>NotificationCard: onSuccess (알림 리스트 갱신)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15–20 minutes

Suggested reviewers

  • evaain706
  • LeeCh0129

Poem

🐇
알림이 뿅! 드롭다운에 담겨,
무한 스크롤로 끝없이 펼쳐져요.
삭제도 척척, 시간도 착착,
로그인 폼은 살짝 위로,
헤더엔 종소리, 로그아웃도 새로!
오늘도 토끼는 코드를 춤추며,
리뷰어님께 기쁜 소식을 전해요. 🛎️✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/89

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@LeeCh0129 LeeCh0129 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다~

@evaain706
Copy link
Contributor

로직과 디바이스별로 반응형 디자인까지 구현하시는데 수고많으셨습니다!

@minimo-9 minimo-9 merged commit 214c0a8 into develop Aug 2, 2025
1 check passed
@minimo-9 minimo-9 deleted the feat/89 branch August 2, 2025 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feature 기능구현 🔨 Refactor 코드 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] 알림 컴포넌트 및 로그아웃 기능 구현

4 participants