Skip to content

Conversation

@yuj2n
Copy link
Contributor

@yuj2n yuj2n commented Jun 11, 2025

📌 변경 사항 개요

공통 드롭다운 메뉴 기능 구현

✨ 요약

공통 드롭다운 메뉴 기능 구현

📝 상세 내용

🐛Fix: favicon 길쭉해보이는 문제 수정

🫧 modify:

  • 파비콘 확장자 수정
  • 헤더 보더 색 추가
  • 프로필 이미지 있는 경우 닉네임 작성

✨feat:

  • 공용 드롭다운 컴포넌트 구현
  • 드롭다운 메뉴 헤더 적용

🔗 관련 이슈

🖼️ 스크린샷

image
image

✅ 체크리스트

  • 브랜치 네이밍 컨벤션을 준수했습니다
  • 커밋 컨벤션을 준수했습니다
  • 코드가 프로젝트의 스타일 가이드라인을 준수합니다

💡 참고 사항

  • 다크모드 토클 가져와서 적용했습니다!!
  • 공용으로 드롭다운 구현해서 제가 UserDropdown에서 사용하는 거 참고하셔서 쓰시면 될 것 같습니다.(align 속성으로 left/right/center로 위치 조정이 가능하긴한데 추후에 사용하시면서 위치 애매하면 스타일 수정을 해봐야할 것 같아용

Summary by CodeRabbit

  • 신규 기능

    • 사용자 프로필을 클릭하면 마이페이지 이동 및 로그아웃 버튼이 포함된 드롭다운 메뉴가 표시됩니다.
    • 테마 토글 기능이 헤더에 추가되었습니다.
    • 새로운 드롭다운 UI 컴포넌트가 도입되었습니다.
  • 버그 수정

    • 프로필 이미지 옆에 표시되는 이름이 고정된 "사용자"에서 실제 닉네임으로 변경되었습니다.
  • 스타일

    • 헤더와 드롭다운의 스타일이 개선되고, 새로운 하단 테두리 유틸리티 클래스가 추가되었습니다.
    • 파비콘이 .png에서 .ico로 변경되었습니다.

@yuj2n yuj2n added this to the 1차 구현 기간 milestone Jun 11, 2025
@yuj2n yuj2n self-assigned this Jun 11, 2025
@yuj2n yuj2n added ✨Feat 기능 개발 🐛Fix 버그 수정 🎨Style UI, 스타일 관련 수정 💄Modify 자잘한 수정 labels Jun 11, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jun 11, 2025

Walkthrough

이번 변경에서는 전역 CSS에 하단 테두리 유틸리티 클래스를 추가하고, 파비콘 경로를 수정했습니다. 또한, Dropdown 및 UserDropdown 컴포넌트가 새롭게 도입되었고, Header 컴포넌트가 리팩토링되어 사용자 인터페이스와 테마 토글 기능이 개선되었습니다. 프로필 표시 방식도 동적으로 변경되었습니다.

Changes

파일/경로 변경 요약
src/app/globals.css .Border-bottom 유틸리티 클래스 추가 (라이트/다크 모드 하단 테두리 색상 적용)
src/app/layout.tsx 파비콘 경로를 /favicon.png에서 /favicon.ico로 변경
src/app/shared/components/common/Dropdown/Dropdown.tsx 새로운 Dropdown 컴포넌트 추가 (트리거, 정렬, 너비, 외부 클릭 감지 등 기능 포함)
src/app/shared/components/common/Profile.tsx 프로필 이미지 옆 텍스트를 고정 "사용자"에서 전달받은 nickname으로 동적 표시로 변경
src/app/shared/components/common/header/Header.tsx 사용자 정보 영역 리팩토링: Profile → UserDropdown, ThemeToggle 추가, 스타일 및 레이아웃 단순화
src/app/shared/components/common/header/UserDropdown.tsx 새로운 UserDropdown 컴포넌트 추가 (프로필 트리거, 마이페이지 이동, 로그아웃 버튼 포함)

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Header
    participant UserDropdown
    participant Router

    User->>Header: 페이지 상단 접근
    Header->>UserDropdown: 프로필/드롭다운 렌더링
    User->>UserDropdown: 프로필 클릭 (드롭다운 오픈)
    User->>UserDropdown: "마이페이지" 클릭
    UserDropdown->>Router: "/mypage"로 이동
    User->>UserDropdown: "로그아웃" 클릭
    UserDropdown->>UserDropdown: 로그아웃 콘솔 출력
Loading

Suggested reviewers

  • Insung-Jo
  • dkslel1225
  • LeeCh0129

Poem

🐰
새로 생긴 드롭다운,
닉네임이 반짝반짝,
테마도 바꿔보고
파비콘도 살짝!
토글과 함께 춤추며
헤더가 더 깔끔해졌네—
토끼도 기쁘게 깡총!

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error https://github.com/npm/cli/issues
npm error A complete log of this run can be found in: /.npm/_logs/2025-06-11T16_58_14_625Z-debug-0.log

✨ Finishing Touches
  • 📝 Generate Docstrings

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

@yuj2n yuj2n removed the 🎨Style UI, 스타일 관련 수정 label Jun 11, 2025
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: 1

🔭 Outside diff range comments (1)
src/app/shared/components/common/Profile.tsx (1)

50-62: ⚠️ Potential issue

imageUrl 프롭이 실제로 사용되지 않음

imageUrl을 전달해도 항상 고정 경로(/images/profile.gif)가 렌더링되어 프롭의 의미가 사라집니다. 또한 alt 텍스트가 닉네임을 포함하지 않아 접근성 측면에서도 보완이 필요합니다.

-        <Image
-          src="/images/profile.gif"
-          fill
-          alt="프로필 이미지"
-          className="size-full object-cover"
-        />
+        <Image
+          src={imageUrl}
+          fill
+          alt={`${nickname}의 프로필 이미지`}
+          className="size-full object-cover"
+        />
🧹 Nitpick comments (7)
src/app/globals.css (1)

43-45: Tailwind 기본 유틸리티와 중복 정의 위험

Tailwind CSS에는 이미 border-b 유틸리티가 존재합니다. 동일한 이름에 접두사를 붙이지 않고 .Border-bottom 클래스를 추가하면 팀원들이 border-b vs .Border-bottom 두 가지 중 어떤 것을 써야 하는지 혼란스러울 수 있고, 스타일 일관성도 깨질 여지가 있습니다. 기존 유틸리티에 @apply로 색상만 확장하거나, 프로젝트 컨벤션에 맞춘 프리픽스(예: App-border-b)를 붙여 중복을 피하는 방안을 검토해 주세요.

src/app/layout.tsx (1)

12-13: 파비콘 메타데이터 확장 고려

단일 icon 항목만 설정하면 일부 브라우저나 PWA 환경에서 고해상도 아이콘이 누락될 수 있습니다. 다음과 같이 shortcut 또는 다양한 sizes를 추가해 대응 범위를 넓히는 것을 권장드립니다.

 icons: {
-   icon: '/favicon.ico',
+   icon: '/favicon.ico',
+   shortcut: '/favicon-32x32.png',
+   other: [
+     { rel: 'apple-touch-icon', url: '/apple-touch-icon.png', sizes: '180x180' },
+   ],
 },
src/app/shared/components/common/header/UserDropdown.tsx (1)

29-37: 다크 모드 호버 스타일 누락

hover:bg-gray-100 hover:text-black만 지정되어 있어 다크 모드에서 호버 시 글자가 안 보일 수 있습니다. Tailwind 다크 변형을 함께 지정해 주세요.

-        className="w-full p-5 text-xs hover:bg-gray-100 hover:text-black"
+        className="w-full p-5 text-xs hover:bg-gray-100 hover:text-black dark:hover:bg-[#2E2E2E] dark:hover:text-white"
src/app/shared/components/common/Dropdown/Dropdown.tsx (1)

33-58: 드롭다운 내부 클릭 후 자동 닫힘 기능 추가 제안

현재 메뉴 항목을 클릭해도 드롭다운이 그대로 열린 채로 남습니다. UX 측면에서 클릭 시 자동 닫힘이 자연스러우므로 children 렌더링 시 onClick 콜백을 주입하거나, context/render props 패턴으로 close() 함수를 노출하는 방식의 개선을 고려해 주세요.

src/app/shared/components/common/header/Header.tsx (3)

26-45: 접근성·UI 세부사항 보완 제안

  1. 현재 페이지를 나타내기 위해 font-semibold만 주고 있는데, 스크린리더용 aria-current="page" 속성을 함께 부여하면 접근성이 향상됩니다.
  2. 두 버튼의 radius 값이 rounded-md vs rounded-6로 다릅니다. 디자인 의도라면 OK지만 통일 의도라면 확인 부탁드립니다.
  3. mr-16이 두 링크 중 하나에만 들어가 있어 좌우 여백이 비대칭입니다.
-<Link
-  href="/dashboard"
-  className={cn(
-    'Border-btn flex items-center gap-6 rounded-md border-solid px-12 py-6',
-    pathname === '/dashboard' && 'font-semibold',
-  )}
->
+<Link
+  href="/dashboard"
+  aria-current={pathname === '/dashboard' ? 'page' : undefined}
+  className={cn(
+    'Border-btn flex items-center gap-6 rounded-md border-solid px-12 py-6',
+    pathname === '/dashboard' && 'font-semibold',
+  )}
+>

동일하게 /modal 링크도 적용하면 됩니다.


53-60: next/image 성능 속성 누락

fill 모드를 사용할 때는 sizes 속성을 지정하지 않으면 CLS(레이아웃 이동) 및 불필요한 리사이즈가 발생할 수 있습니다.

<Image
   src="/images/collaborator.png"
   fill
+  sizes="48px"
   alt="초대된 사용자"
   style={{ objectFit: 'cover' }}
/>

필요 시 priority 플래그도 고려해 주세요.


61-61: 구분 기호 | 는 엘리먼트로 감싸는 편이 안전

맨-바로가기 구분용 | 가 텍스트 노드로 노출되어 있어 마진 조정·ARIA 속성 부여가 어렵습니다. 최소한 <span aria-hidden ...> 로 감싸 두면 스타일·접근성 관리가 용이합니다.

- |
+ <span aria-hidden="true" className="px-8 text-gray-400">|</span>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 70eba7b and bb6dbf1.

⛔ Files ignored due to path filters (2)
  • public/favicon.ico is excluded by !**/*.ico
  • public/favicon.png is excluded by !**/*.png
📒 Files selected for processing (6)
  • src/app/globals.css (1 hunks)
  • src/app/layout.tsx (1 hunks)
  • src/app/shared/components/common/Dropdown/Dropdown.tsx (1 hunks)
  • src/app/shared/components/common/Profile.tsx (1 hunks)
  • src/app/shared/components/common/header/Header.tsx (2 hunks)
  • src/app/shared/components/common/header/UserDropdown.tsx (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (3)
src/app/shared/components/common/header/UserDropdown.tsx (2)
src/app/shared/components/common/Dropdown/Dropdown.tsx (1)
  • Dropdown (13-59)
src/app/shared/components/common/Profile.tsx (1)
  • Profile (46-80)
src/app/shared/components/common/Dropdown/Dropdown.tsx (1)
src/app/shared/lib/cn.ts (1)
  • cn (4-6)
src/app/shared/components/common/header/Header.tsx (3)
src/app/shared/lib/cn.ts (1)
  • cn (4-6)
src/app/shared/components/common/header/UserDropdown.tsx (1)
  • UserDropdown (7-42)
src/app/shared/components/ThemeToggle.tsx (1)
  • ThemeToggle (6-27)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: eslint-check
🔇 Additional comments (3)
src/app/shared/components/common/header/UserDropdown.tsx (1)

14-16: 로그아웃 로직 미구현

console.log으로만 처리되어 있어 실제 인증 상태가 변경되지 않습니다. NA API 호출 또는 authContext.logout() 같은 실제 구현으로 교체하거나 TODO: 주석으로 명시해 주세요.

src/app/shared/components/common/header/Header.tsx (2)

5-9: 임포트 구성 깔끔, 별다른 이슈 없음

next/link, next/navigation, 신규 공통 컴포넌트들이 올바르게 임포트되어 있습니다. use client 지시어도 포함되어 있어 SSR-hydration 오류 우려도 없습니다.


64-67: 공통 드롭다운·다크모드 토글 통합 정상 동작 확인

UserDropdownThemeToggle 이 동일 flex 컨테이너로 묶여 있어 레이아웃도 깔끔합니다. 추가 피드백 없습니다.

Comment on lines +22 to +23
<Profile nickname="닉네임" size={36} />
</div>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

닉네임 하드코딩

<Profile>"닉네임"을 하드코딩하면 실제 사용자 정보를 표시하지 못합니다. session 또는 user 컨텍스트에서 닉네임을 받아와 전달하도록 수정해 주세요.

-          <Profile nickname="닉네임" size={36} />
+          <Profile nickname={user.nickname} imageUrl={user.imageUrl} size={36} />

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/app/shared/components/common/header/UserDropdown.tsx at lines 22-23, the
Profile component currently has the nickname prop hardcoded as "닉네임". Replace
this hardcoded string by retrieving the actual user's nickname from the session
or user context and pass it dynamically to the Profile component to display the
correct user information.

Copy link

@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.

드롭다운 메뉴 기능을 잘 구현해주셨습니다~ 고생많으셨습니다👍

Copy link

@Insung-Jo Insung-Jo left a comment

Choose a reason for hiding this comment

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

드롭 다운 구현 수고 많으셨습니다 👍 👍

Comment on lines +46 to +51
width,
{
'left-0': align === 'left',
'right-0': align === 'right',
'left-1/2 -translate-x-1/2': align === 'center',
},

Choose a reason for hiding this comment

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

이렇게 작성하면 어떻게 적용이 되는 건가요?

Copy link
Contributor Author

@yuj2n yuj2n Jun 12, 2025

Choose a reason for hiding this comment

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

드롭다운 컴포넌트 사용 시에 와 같이 사용해주시면 좌측 정렬이 가능해집니다!!
이후에 사용해보고 너무 치우친다 싶으면 'leftt-0' 부분을 'left-4'와 같이 조정해주는 식으로 변경하면 될 것 같습니당

Copy link
Contributor

@dkslel1225 dkslel1225 left a comment

Choose a reason for hiding this comment

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

드롭다운 구현 수고하셨습니다!

trigger={
<div className="flex cursor-pointer items-center gap-8">
<Profile nickname="닉네임" size={36} />
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

오... 프롭으로 아예 jsx 덩어리를 전달할수도 있군요

Copy link
Contributor Author

@yuj2n yuj2n Jun 12, 2025

Choose a reason for hiding this comment

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

맞아용~ JSX 덩어리 전체를 prop으로 전달하는 게 가능하다고 합니다.
이는 실제로 레고 블럭처럼 조립 가능하고 재사용성과 유연성 증가하는 동시에 역할 분리도 확실해서 React에서 매우 일반적이고 강력한 패턴이라고 합니다!!

@yuj2n yuj2n merged commit a755550 into develop Jun 12, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨Feat 기능 개발 🐛Fix 버그 수정 💄Modify 자잘한 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants