Skip to content

Conversation

@yuj2n
Copy link
Contributor

@yuj2n yuj2n commented Jun 11, 2025

📌 변경 사항 개요

  • 파일명 변경 사항 미반영 부분 수정
  • 커스텀 유틸리티 클래스 추가
  • clsx + twMerge 반영
  • 공통 사용자 프로필 헤더에 반영

✨ 요약

공통 사용자 프로필 구현 및 추가 사항 반영

📝 상세 내용

🐛Fix: 파일명 변경 사항 미반영 에러 수정

🔧Chore: lib 사용을 위한 alias 설정 추가

🎨Style:

  • global.css의 커스텀 유틸리티 클래스 적용
  • 프로필 이미지 흰 글씨를 위한 커스텀 클래스 추가

✨Feat:

  • clsx와 twMerge의 병합 구현
  • clsx + twMerge로 조건부 스타일 간결화
  • 공통 사용자 프로필 컴포넌트 구현
  • 공통 프로필 이미지 적용 및 헤더 스타일 일부 수정

🔗 관련 이슈

🖼️ 스크린샷

image

✅ 체크리스트

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

💡 참고 사항

  • 프로필에 들어갈 글씨의 경우 흰 글씨로 되어있어서 커스텀 추가했습니다!!
  • 프로필 이미지에 들어갈 글자를 영어로 통합하기로 하였으나 한글은 한글 첫 글자, 영어는 첫 글자 대문자로 가져오는 것이 더 간편하면서 UI적으로도 괜찮을 것 같아서 이를 토대로 구현하였습니다!! 추가로 반영이 필요해 보이는 경우 적용하도록 하겠습니다
  • 조건부 스타일링 하시는 경우에 src/app/shared/lib/cn.ts 파일의 clsx + twMerge 방식 반영하여 사용하시면 될 것 같습니다!!
  • 최대한 로직 이해도를 높이기 위해 주석을 활용했습니당

Summary by CodeRabbit

  • 신규 기능

    • 사용자 프로필을 표시하는 Profile 컴포넌트가 추가되었습니다.
    • Tailwind CSS 클래스 병합을 위한 cn 유틸리티 함수가 도입되었습니다.
    • .Text-white 텍스트 색상 유틸리티 클래스가 추가되었습니다.
  • 리팩터링

    • 헤더에서 사용자 프로필 표시 방식이 Profile 컴포넌트로 교체되고, 스타일이 커스텀 유틸리티 클래스로 정리되었습니다.
  • 환경 설정

    • TypeScript 경로 별칭에 @lib/*가 추가되어 라이브러리 경로 사용이 편리해졌습니다.

@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, 스타일 관련 수정 labels Jun 11, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jun 11, 2025

Walkthrough

새로운 Profile 컴포넌트가 추가되어 사용자 프로필 표시 방식을 개선하였고, 헤더에서 직접 상태 관리 및 로그아웃 로직을 제거했습니다. Tailwind CSS 유틸리티 클래스 및 클래스 병합 함수(cn)가 도입되었으며, 타입스크립트 경로 별칭(@lib/*)이 추가되었습니다. 또한 새로운 텍스트 색상 유틸리티 클래스가 CSS에 추가되었습니다.

Changes

파일/경로 변경 요약
src/app/globals.css .Text-white 텍스트 색상 유틸리티 클래스 추가
src/app/shared/components/common/Profile.tsx Profile 컴포넌트 및 닉네임 기반 이니셜/색상 생성 로직 추가
src/app/shared/components/common/header/Header.tsx 사용자 상태 및 로그아웃 로직 제거, Profile 컴포넌트 도입, 스타일링 및 클래스 병합 방식 개선
src/app/shared/lib/cn.ts Tailwind CSS 클래스 병합 유틸리티 함수 cn 추가
tsconfig.json 타입스크립트 경로 별칭에 @lib/*./src/app/shared/lib/* 추가

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Header
    participant Profile

    User->>Header: 페이지 접근
    Header->>Profile: nickname, imageUrl, size 전달
    Profile-->>Header: 프로필 UI 반환
    Header-->>User: 프로필 포함 헤더 렌더링
Loading

Poem

🐇
새 프로필 토끼가 등장했어요,
색상과 이니셜로 반짝반짝 빛나요!
헤더는 깔끔, 유틸도 추가,
CSS엔 하얀 글씨가 반겨주죠.
코드의 숲에 별칭도 심었으니,
오늘도 개발은 한결 더 즐거워요!

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-11T03_24_13_495Z-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.

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: 3

🧹 Nitpick comments (4)
src/app/globals.css (1)

31-33: 이름-의미 불일치: .Text-white 클래스가 다크모드에서 흰색이 아님

.Text-white 라는 네이밍은 “항상 흰색 텍스트”를 기대하게 만드는데, 다크모드에서는 #333236(짙은 회색)으로 설정되어 있습니다.
향후 유지보수를 위해 네이밍을 수정하거나 다크모드에서도 흰색을 유지하도록 색상을 맞춰 주세요.

src/app/shared/lib/cn.ts (1)

4-6: 가변 인자 전달 시 배열 대신 전개 연산자 사용 권장

clsx 는 rest 파라미터를 받습니다. 배열을 넘겨도 동작하지만, 의도 전달력과 타입 추론을 위해 전개 연산자를 사용하는 편이 좋습니다.

-return twMerge(clsx(inputs))
+return twMerge(clsx(...inputs))
src/app/shared/components/common/Profile.tsx (1)

65-78: 루트 엘리먼트가 없어 레이아웃 제어가 어려움

이미지 미보유 분기에서 <></> 프래그먼트로 2개의 형제 요소를 반환하고 있습니다.
헤더 등에서 정렬하려면 상위 래퍼(div.flex.items-center.gap-4 등)로 감싸는 편이 안정적입니다.

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

64-65: 불필요한 구분 기호 | 문자 노출

|{/* 내 프로필 이미지 */} 구문으로 인해 실제 화면에 | 가 그대로 렌더링됩니다. 의도된 디자인이 아니라면 제거해주세요.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 447016c and 56a273a.

📒 Files selected for processing (5)
  • src/app/globals.css (1 hunks)
  • src/app/shared/components/common/Profile.tsx (1 hunks)
  • src/app/shared/components/common/header/Header.tsx (5 hunks)
  • src/app/shared/lib/cn.ts (1 hunks)
  • tsconfig.json (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/app/shared/components/common/header/Header.tsx (2)
src/app/shared/lib/cn.ts (1)
  • cn (4-6)
src/app/shared/components/common/Profile.tsx (1)
  • Profile (46-80)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: eslint-check
🔇 Additional comments (2)
tsconfig.json (1)

28-30: 경로 별칭 추가 시 ESLint/VSCode 설정도 동기화 필요

"@lib/*" 별칭을 추가하셨는데, ESLint(import/resolver)와 VSCode paths 설정이 함께 갱신되지 않으면 IDE에서 경로를 인식하지 못해 경고가 발생할 수 있습니다. 확인 부탁드립니다.

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

44-47: rounded-6 는 Tailwind 기본 클래스가 아닙니다

Tailwind 3.x 기준으로는 rounded-[6px]rounded-md 등을 사용해야 합니다.
커스텀 플러그인을 사용하지 않는다면 클래스명이 무시됩니다.

Comment on lines +1 to +3
import { clsx, type ClassValue } from 'clsx'
import { twMerge } from 'tailwind-merge'

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

clsx 기본-/명명형 가져오기 오류로 런타임 예외 발생

clsx 는 default export 입니다. 현재 형태로는 clsxundefined 가 되어 twMerge(undefined) 호출 시 크리티컬 런타임 오류가 납니다.

-import { clsx, type ClassValue } from 'clsx'
+import clsx, { type ClassValue } from 'clsx'
📝 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
import { clsx, type ClassValue } from 'clsx'
import { twMerge } from 'tailwind-merge'
import clsx, { type ClassValue } from 'clsx'
import { twMerge } from 'tailwind-merge'
🤖 Prompt for AI Agents
In src/app/shared/lib/cn.ts at lines 1 to 3, the import of clsx is incorrect
because clsx is a default export, not a named export. This causes clsx to be
undefined and leads to a runtime error when calling twMerge(clsx). Fix this by
importing clsx as the default import without curly braces, ensuring clsx is
properly defined before passing it to twMerge.

Comment on lines +50 to +62
return imageUrl ? (
// 프로필 이미지가 있을 때
<div className="flex items-center gap-4">
<div className="relative size-48 overflow-hidden rounded-full">
<Image
src="/images/profile.gif"
fill
alt="프로필 이미지"
className="size-full object-cover"
/>
</div>
<span className="text-sm font-semibold">사용자</span>
</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

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

imageUrl 을 받아 놓고 하드코딩된 "/images/profile.gif" 를 렌더링하고 있어 기능이 동작하지 않습니다.

-        <Image
-          src="/images/profile.gif"
+        <Image
+          src={imageUrl}

또한 표시되는 이름이 "사용자" 로 고정되어 있어 nickname 과 불일치합니다.

📝 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
return imageUrl ? (
// 프로필 이미지가 있을 때
<div className="flex items-center gap-4">
<div className="relative size-48 overflow-hidden rounded-full">
<Image
src="/images/profile.gif"
fill
alt="프로필 이미지"
className="size-full object-cover"
/>
</div>
<span className="text-sm font-semibold">사용자</span>
</div>
return imageUrl ? (
// 프로필 이미지가 있을 때
<div className="flex items-center gap-4">
<div className="relative size-48 overflow-hidden rounded-full">
<Image
- src="/images/profile.gif"
+ src={imageUrl}
fill
alt="프로필 이미지"
className="size-full object-cover"
/>
</div>
<span className="text-sm font-semibold">사용자</span>
</div>
🤖 Prompt for AI Agents
In src/app/shared/components/common/Profile.tsx around lines 50 to 62, the
imageUrl prop is not used and the profile image source is hardcoded to
"/images/profile.gif". Replace the hardcoded src with the imageUrl prop to
correctly display the passed profile image. Also, update the displayed name from
the fixed string "사용자" to use the nickname prop so the rendered name matches the
user's nickname.

Comment on lines 67 to 72
<button onClick={goToMypage} className="text-xs">
마이페이지
</button>
<button onClick={logout} className="text-xs">
<button onClick={goToMypage} className="text-xs">
로그아웃
</button>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

로그아웃 버튼이 실제 로그아웃을 수행하지 않음

onClick={goToMypage} 로 연결되어 있어 ‘마이페이지’ 와 동일한 동작을 합니다. 로그아웃 로직(세션 제거, redirect 등)을 별도 함수로 분리해 연결해야 합니다.

🤖 Prompt for AI Agents
In src/app/shared/components/common/header/Header.tsx around lines 67 to 72, the
logout button incorrectly uses the goToMypage function for its onClick handler,
causing it to perform the same action as the My Page button. Create a separate
logout handler function that performs the logout logic such as clearing the
session and redirecting the user, then assign this new function to the logout
button's onClick event.

@yuj2n yuj2n closed this Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨Feat 기능 개발 🐛Fix 버그 수정 🎨Style UI, 스타일 관련 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants