Skip to content

Conversation

@Insung-Jo
Copy link

@Insung-Jo Insung-Jo commented Jun 12, 2025

📌 변경 사항 개요

  • AuthLogo 컴포넌트 구현했습니다.

✨ 요약

  • AuthLogo 컴포넌트 구현했습니다.

📝 상세 내용

export default function AuthLogo({ text }: AuthLogoProps): JSX.Element {
  const { resolvedTheme } = useTheme()

  const isDark = resolvedTheme === 'dark'

  return (
    <div className="flex w-[230px] flex-col items-center justify-center gap-12">
      <Link className="relative block h-[250px] w-full" href="/">
        <Image
          src={isDark ? '/images/logo-dark.svg' : '/images/logo-light.svg'}
          alt="CoPlan 로고"
          className="object-contain"
          fill
          priority
        />
      </Link>
      <span className="Text-black text-xl">{text}</span>
    </div>
  )
}

// 사용 예시
<AuthLogo text="오신 것을 환영합니다!"/>
  • resolvedTheme을 통하여 현재 브라우저에 실제로 적용된 최종 테마 상태 값을 받아와서 조건부로 src 경로를 바꿀 수 있게 구현했습니다.
  • propstext를 받아와서 하단부에 텍스트를 작성할 수 있게 구현했습니다.

🔗 관련 이슈

#45

🖼️ 스크린샷

  • light-mode
    image

  • dark-mode
    image

✅ 체크리스트

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

💡 참고 사항

  • 아무래도 브랜치명이 조금 걸리는 부분이 있습니다! (auth 페이지가 아닌 login, signup 페이지로 나뉘다 보니 현 브랜치 명으로 작성)

Summary by CodeRabbit

  • New Features
    • 테마(다크/라이트)에 따라 자동으로 변경되는 인증 로고 컴포넌트가 추가되었습니다.
    • 로고 하단에 텍스트가 함께 표시됩니다.
    • 로고 클릭 시 메인 페이지로 이동할 수 있습니다.

@Insung-Jo Insung-Jo added this to the 2차 구현 기간 milestone Jun 12, 2025
@Insung-Jo Insung-Jo self-assigned this Jun 12, 2025
@Insung-Jo Insung-Jo added ✨Feat 기능 개발 🎨Style UI, 스타일 관련 수정 labels Jun 12, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jun 12, 2025

Walkthrough

새로운 React 함수형 컴포넌트 AuthLogo가 추가되었습니다. 이 컴포넌트는 text라는 문자열 prop을 받아, 현재 테마에 따라 다크 또는 라이트 로고 이미지를 조건부로 렌더링합니다. 로고는 Next.js의 Link로 감싸져 있으며, 그 아래에 전달받은 텍스트가 표시됩니다.

Changes

파일 경로 변경 요약
src/app/features/auth/components/AuthLogo.tsx AuthLogo 컴포넌트 신규 추가, 테마별 로고 및 텍스트 렌더링

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant AuthLogo(Component)
    participant ThemeProvider
    participant NextImage
    participant NextLink

    User->>AuthLogo: text prop 전달
    AuthLogo->>ThemeProvider: 현재 테마 조회
    ThemeProvider-->>AuthLogo: 'dark' 또는 'light' 반환
    AuthLogo->>NextImage: 테마에 따라 로고 이미지 선택
    AuthLogo->>NextLink: "/" 링크로 로고 감싸기
    AuthLogo->>User: 로고와 텍스트 렌더링
Loading

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-12T08_56_56_188Z-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: 2

🧹 Nitpick comments (1)
src/app/features/auth/components/AuthLogo.tsx (1)

11-15: resolvedTheme 초기값으로 인한 FOUC(Flash of Unstyled Content) 가능성
useTheme()가 클라이언트-사이드에서만 값을 설정하므로, 첫 렌더링 시 resolvedThemeundefined일 수 있습니다. 그 경우 라이트 로고가 잠깐 표시됐다가 다크로 바뀌는 화면 번쩍임이 발생할 수 있습니다. isMounted 플래그로 초기 렌더를 건너뛰거나, resolvedTheme ? … : null 방식으로 처리해 깔끔한 전환을 보장해 주세요.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between fdb2220 and 41ea75b.

⛔ Files ignored due to path filters (1)
  • public/images/logo-dark.svg is excluded by !**/*.svg
📒 Files selected for processing (1)
  • src/app/features/auth/components/AuthLogo.tsx (1 hunks)

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

🧹 Nitpick comments (3)
src/app/features/auth/components/AuthLogo.tsx (3)

11-15: 테마 감지 로직

  • useTheme 훅의 resolvedTheme을 기반으로 isDark 플래그를 설정하는 로직이 직관적입니다.
  • 초기 hydration 시 resolvedThemeundefined가 될 수 있어 테마 플래시(FOUC)를 방지하려면 마운트 여부를 체크하는 추가 로직도 고려해보세요.

17-26: 이미지 최적화 사용

  • fillpriority 속성으로 LCP 개선을 잘 처리했습니다.
  • 추가로 placeholder="blur"blurDataURL 설정을 적용하면 로고 로딩 UX가 더욱 부드러워집니다.

11-30: 접근성과 테스트 보강 제안

  • alt 텍스트("CoPlan 로고")를 언어별로 분리하거나 prop으로 전달해 i18n을 지원할 수 있습니다.
  • React Testing Library와 Jest를 활용해 컴포넌트 스냅샷 및 렌더링 검증 테스트를 추가하면 안정성이 높아집니다.
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between fdb2220 and 41ea75b.

⛔ Files ignored due to path filters (1)
  • public/images/logo-dark.svg is excluded by !**/*.svg
📒 Files selected for processing (1)
  • src/app/features/auth/components/AuthLogo.tsx (1 hunks)
🔇 Additional comments (2)
src/app/features/auth/components/AuthLogo.tsx (2)

1-5: 클라이언트 컴포넌트 선언 및 임포트 구성 적절

  • 'use client' 지시자로 컴포넌트를 클라이언트 전용으로 지정했고, next/image, next/link, next-themes 임포트 순서도 깔끔합니다.

7-9: Props 타입 선언이 명확합니다

  • AuthLogoProps 인터페이스로 text prop의 타입을 강제해 타입 안전성을 보장합니다.

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

🧹 Nitpick comments (2)
src/app/features/auth/components/AuthLogo.tsx (2)

11-15: 초기 테마 로딩 처리 고려 필요
resolvedTheme은 클라이언트 마운트 후에야 결정되므로, 초기 렌더링 시 undefined로 나타나 플래시(flash)가 발생할 수 있습니다. 로고가 깜빡거리는 UX를 방지하려면 if (!resolvedTheme) return null; 또는 로딩 스켈레톤 처리를 검토하세요.


17-26: 정적 이미지 import 활용 제안
문자열 경로 대신 public 폴더에서 로고 SVG를 직접 import하면 타입 안전성과 번들링 최적화를 얻을 수 있습니다. 예를 들어:

-import Image from 'next/image'
+import Image from 'next/image'
+import darkLogo from 'public/images/logo-dark.svg'
+import lightLogo from 'public/images/logo-light.svg'
...
-   <Image
-     src={isDark ? '/images/logo-dark.svg' : '/images/logo-light.svg'}
+   <Image
+     src={isDark ? darkLogo : lightLogo}
...

이렇게 변경하면 빌드 타임에 이미지 크기도 자동으로 추출됩니다.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between fdb2220 and 41ea75b.

⛔ Files ignored due to path filters (1)
  • public/images/logo-dark.svg is excluded by !**/*.svg
📒 Files selected for processing (1)
  • src/app/features/auth/components/AuthLogo.tsx (1 hunks)
🔇 Additional comments (2)
src/app/features/auth/components/AuthLogo.tsx (2)

1-5: 'use client' 지시어 및 import 확인
'AuthLogo'가 클라이언트 컴포넌트로 동작하도록 'use client'를 잘 선언하셨습니다. next/image, next/link, next-themes의 import 순서도 적절합니다.


7-9: Props 타입 정의가 명확합니다
AuthLogoProps에서 text: string을 명시하신 부분이 간결하고 이해하기 쉽습니다. 불필요한 prop이 없고 확장성도 좋습니다.

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

🧹 Nitpick comments (1)
src/app/features/auth/components/AuthLogo.tsx (1)

11-15: resolvedTheme 초기값 처리 및 FOUC 방지 고려 필요
resolvedTheme가 클라이언트 마운트 이전에 undefined가 될 수 있어 잠재적 플리커(Flicker)가 발생할 수 있습니다. 마운트 완료 후 렌더링하거나 기본 테마를 설정해 초기값을 고정하는 로직(useEffect + mounted 상태, resolvedTheme ?? 'light' 등) 도입을 권장합니다.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between fdb2220 and 41ea75b.

⛔ Files ignored due to path filters (1)
  • public/images/logo-dark.svg is excluded by !**/*.svg
📒 Files selected for processing (1)
  • src/app/features/auth/components/AuthLogo.tsx (1 hunks)
🔇 Additional comments (4)
src/app/features/auth/components/AuthLogo.tsx (4)

1-6: 초기 설정 및 의존성 임포트: 적절합니다
'use client' 디렉티브와 next/image, next/link, next-themes 훅의 임포트 구성이 올바릅니다.


7-9: Props 인터페이스 선언이 명확합니다
AuthLogoPropstext: string으로 잘 정의되어 있으며, 컴포넌트 사용 시 타입 안정성을 보장합니다.


17-18: 레이아웃 컨테이너 및 링크 구조: 적절합니다
flex 레이아웃과 relative 컨테이너를 활용해 이미지가 올바르게 fill되는 구조를 잘 구성했습니다.


19-25: next/image 사용 최적화
fill, priority, object-contain 조합으로 로고를 최적화했습니다. 동적 src(public/images/...) 사용도 허용되는 패턴입니다.

@Insung-Jo Insung-Jo linked an issue Jun 12, 2025 that may be closed by this pull request
1 task
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.

테마 상태를 가져와서 체크하면 되는군여, 구현 수고하셨습니다! 로그인 회원가입 페이지에서 로고 밑에 텍스트 들어간다는 걸 지금 알았네요 ㅋㅋㅋ

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.

고생많으셨습니다~ 깔끔하네요👍
resolovedTheme를 사용해서 적용된 테마 상태를 가져오는 것?도 좋구요!

@Insung-Jo Insung-Jo merged commit bc76955 into develop Jun 12, 2025
2 checks passed
Copy link
Contributor

@yuj2n yuj2n left a comment

Choose a reason for hiding this comment

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

인성님 인증 로고 컴포넌트 구현 수고하셨습니다!!

}

export default function AuthLogo({ text }: AuthLogoProps): JSX.Element {
const { resolvedTheme } = useTheme()
Copy link
Contributor

Choose a reason for hiding this comment

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

next-themes의 useTheme 훅으로 resolvedTheme 문자열을 가져올 수 있군용!!

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

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨Feat: AuthLogo 컴포넌트 구현

5 participants