Skip to content

Conversation

@oesnuj
Copy link
Member

@oesnuj oesnuj commented Nov 15, 2025

#️⃣연관된 이슈

#843

📝작업 내용

관리자 페이지 헤더에 현재 관리 중인 동아리 정보(이름, 로고)를 표시하도록 개선했습니다.

image

변경 사항

1. AdminProfile 컴포넌트 추가

  • 동아리 이름과 로고를 표시하는 새로운 컴포넌트 생성

2. Header 컴포넌트 수정

  • 관리자 페이지에서는 AdminProfile, 일반 페이지에서는 SearchBox를 표시하도록 조건부 렌더링 적용

주요 기능

  • AdminClubContext에서 clubId를 가져와 동아리 정보 조회
  • 동아리 이름과 함께 환영 메시지 표시 ("동아리명님 환영합니다!")
  • 동아리 로고를 원형 이미지로 표시 (없을 경우 기본 이미지)
  • 모바일에서는 로고만 표시하여 공간 효율성 확보

중점적으로 리뷰받고 싶은 부분

  • AdminProfile 컴포넌트를 Header/admin/ 폴더에 분리한 구조가 적절한지

🫡 참고사항

  • 동아리 정보가 없을 때 기본 이미지와 메시지 처리 완료
  • 여러 동아리를 관리하는 경우를 대비한 명확한 UI 제공

Summary by CodeRabbit

릴리스 노트

  • 신규 기능
    • 관리자 페이지의 헤더에 프로필 영역이 추가되어 클럽명과 로고를 표시합니다.
    • 헤더 레이아웃을 개선하여 더 나은 사용자 경험을 제공합니다.

@oesnuj oesnuj self-assigned this Nov 15, 2025
@oesnuj oesnuj added 🎨 Design 마크업 & 스타일링 💻 FE Frontend labels Nov 15, 2025
@vercel
Copy link

vercel bot commented Nov 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
moadong Ready Ready Preview Comment Nov 15, 2025 8:47am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 15, 2025

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: Invalid regex pattern for base branch. Received: "**" at "reviews.auto_review.base_branches[0]"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • 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

개요

관리자 페이지 헤더에 동아리명과 프로필 섹션을 추가하는 변경사항입니다. AdminProfile 컴포넌트를 신규 생성하고, Header 컴포넌트를 리팩토링하여 관리자 페이지에서 SearchBox 대신 AdminProfile을 렌더링하며, 스타일 컴포넌트 3개를 추가했습니다.

변경사항

계층 / 파일 변경 요약
스타일 컴포넌트 추가
frontend/src/components/common/Header/Header.styles.ts
AdminProfileContainer, AdminProfileText, AdminProfileImage 3개의 스타일 컴포넌트 신규 추출 및 내보내기
헤더 구조 리팩토링
frontend/src/components/common/Header/Header.tsx
AdminProfile 컴포넌트 import 추가 및 통합; isAdminPage 조건에 따라 AdminProfile 또는 SearchBox 렌더링; MenuButton을 관리자 페이지에서만 숨김
관리자 프로필 컴포넌트
frontend/src/components/common/Header/admin/AdminProfile.tsx
신규 파일: useAdminClubContext와 useGetClubDetail를 활용하여 동아리명 및 로고를 표시하는 AdminProfile 컴포넌트

코드 리뷰 난이도 평가

🎯 2 (단순) | ⏱️ ~12분

  • 검토 포인트:
    • AdminProfile.tsx에서 useAdminClubContext 및 useGetClubDetail 훅의 올바른 사용 확인
    • Header.tsx 조건부 렌더링 로직의 정확성 검증 (isAdminPage 플래그 처리)
    • 스타일 컴포넌트의 반응형 디자인 및 기존 미디어 쿼리 호환성 확인

연관 이슈

  • MOA-325: 본 PR이 "관리자 헤더에 동아리명 및 프로필 섹션 추가" 목표를 직접 구현합니다.

제안 라벨

✨ Feature

제안 리뷰어

  • seongwon030
  • lepitaaar
  • seongje973

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 제목은 AdminProfile 컴포넌트 추가를 통해 관리자가 관리 중인 동아리 정보를 헤더에 표시하는 주요 변경사항을 명확하고 구체적으로 설명하고 있습니다.
Linked Issues check ✅ Passed 풀 리퀘스트의 변경사항들이 MOA-325의 목표(관리자 헤더에 동아리명 및 프로필 섹션 추가)를 충족합니다. AdminProfile 컴포넌트가 추가되었고, Header 컴포넌트가 수정되어 관리자 페이지에서 동아리 정보가 표시됩니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 관리자 헤더에 동아리 정보를 표시하는 범위 내에 있으며, 스타일 컴포넌트, AdminProfile 컴포넌트 추가, Header 구조 리팩토링 등이 모두 해당 목표를 지원합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/#843-admin-header-profile-MOA-325

Tip

📝 Customizable high-level summaries are now available!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide custom instructions to shape the summary (bullet lists, tables, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example:

"Create a concise high-level summary as a bullet-point list. Then include a Markdown table showing lines added and removed by each contributing author."


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
Contributor

@lepitaaar lepitaaar 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
Contributor

@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

🧹 Nitpick comments (2)
frontend/src/components/common/Header/admin/AdminProfile.tsx (2)

6-9: 로딩 및 에러 상태 처리 고려

현재 useGetClubDetail 훅에서 data만 구조 분해하고 있어, 데이터 로딩 중이거나 에러 발생 시 사용자에게 동일한 폴백("관리자님 환영합니다!")이 표시됩니다. 더 나은 사용자 경험을 위해 로딩 상태나 에러 상태를 표시하는 것을 고려해보세요.

예시:

-  const { data: clubDetail } = useGetClubDetail(clubId || '');
+  const { data: clubDetail, isLoading, isError } = useGetClubDetail(clubId || '');
   const { name, logo } = clubDetail || {};

+  if (isLoading) {
+    return <Styled.AdminProfileContainer>로딩 중...</Styled.AdminProfileContainer>;
+  }
+
+  if (isError) {
+    return <Styled.AdminProfileContainer>동아리 정보를 불러올 수 없습니다.</Styled.AdminProfileContainer>;
+  }

16-19: 접근성 개선: 동적 alt 텍스트 사용

이미지의 alt 속성이 정적인 "관리자 프로필 이미지"로 고정되어 있습니다. 동아리 이름을 포함한 동적인 설명을 제공하면 스크린 리더 사용자에게 더 유용한 정보를 제공할 수 있습니다.

       <Styled.AdminProfileImage
         src={logo || DefaultMoadongLogo}
-        alt='관리자 프로필 이미지'
+        alt={`${name || '관리자'} 동아리 로고`}
       />
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 8d97ca8 and 329850b.

📒 Files selected for processing (3)
  • frontend/src/components/common/Header/Header.styles.ts (1 hunks)
  • frontend/src/components/common/Header/Header.tsx (3 hunks)
  • frontend/src/components/common/Header/admin/AdminProfile.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: seongwon030
Repo: Moadong/moadong PR: 195
File: frontend/src/pages/AdminPage/AdminPage.tsx:7-7
Timestamp: 2025-03-19T05:18:07.818Z
Learning: AdminPage.tsx에서 현재 하드코딩된 클럽 ID('67d2e3b9b15c136c6acbf20b')는 로그인 기능 구현 후 동적으로 가져오는 방식으로 수정될 예정입니다.
📚 Learning: 2025-03-19T05:18:07.818Z
Learnt from: seongwon030
Repo: Moadong/moadong PR: 195
File: frontend/src/pages/AdminPage/AdminPage.tsx:7-7
Timestamp: 2025-03-19T05:18:07.818Z
Learning: AdminPage.tsx에서 현재 하드코딩된 클럽 ID('67d2e3b9b15c136c6acbf20b')는 로그인 기능 구현 후 동적으로 가져오는 방식으로 수정될 예정입니다.

Applied to files:

  • frontend/src/components/common/Header/admin/AdminProfile.tsx
🧬 Code graph analysis (2)
frontend/src/components/common/Header/Header.styles.ts (1)
frontend/src/styles/mediaQuery.ts (1)
  • media (8-14)
frontend/src/components/common/Header/admin/AdminProfile.tsx (2)
frontend/src/context/AdminClubContext.tsx (1)
  • useAdminClubContext (39-46)
frontend/src/hooks/queries/club/useGetClubDetail.ts (1)
  • useGetClubDetail (6-20)
🔇 Additional comments (4)
frontend/src/components/common/Header/Header.styles.ts (2)

174-178: LGTM!

AdminProfile 컨테이너의 레이아웃 구성이 적절합니다.


180-187: LGTM!

모바일에서 텍스트를 숨겨 공간을 절약하는 반응형 디자인이 잘 구현되었습니다.

frontend/src/components/common/Header/Header.tsx (2)

9-9: LGTM!

AdminProfile 컴포넌트 import와 관리자 페이지 판별 로직이 적절합니다.

Also applies to: 18-18


78-90: LGTM!

관리자 페이지와 일반 페이지 간의 조건부 렌더링 로직이 명확하고 올바르게 구현되었습니다. MenuButton을 관리자 페이지에서 제외하고, AdminProfile과 SearchBox를 적절히 전환하는 구조가 잘 설계되었습니다.

Comment on lines +189 to +193
export const AdminProfileImage = styled.img`
width: 40px;
height: auto;
border-radius: 50%;
`;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

원형 이미지 비율 깨짐 방지 필요

height: auto를 사용하면 정사각형이 아닌 이미지의 경우 원형이 아닌 타원형으로 표시됩니다. 완벽한 원형을 유지하려면 height를 명시적으로 지정하고 object-fit: cover를 추가해야 합니다.

 export const AdminProfileImage = styled.img`
   width: 40px;
-  height: auto;
+  height: 40px;
   border-radius: 50%;
+  object-fit: cover;
 `;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export const AdminProfileImage = styled.img`
width: 40px;
height: auto;
border-radius: 50%;
`;
export const AdminProfileImage = styled.img`
width: 40px;
height: 40px;
border-radius: 50%;
object-fit: cover;
`;
🤖 Prompt for AI Agents
In frontend/src/components/common/Header/Header.styles.ts around lines 189 to
193, the AdminProfileImage uses height: auto which causes non-square images to
render as ovals; change the styles to set an explicit square height equal to
width (e.g., height: 40px) and add object-fit: cover so images are cropped to
fill the circle while preserving aspect ratio and keep border-radius: 50% to
maintain the circular shape.

Copy link
Member

@seongwon030 seongwon030 left a comment

Choose a reason for hiding this comment

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

사용자와 관리자 헤더 통일 좋아요~ 문구 추가한 것도 더 친근감 있네요

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🎨 Design 마크업 & 스타일링 💻 FE Frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants