Skip to content

Conversation

@dbstj0403
Copy link
Collaborator

@dbstj0403 dbstj0403 commented May 19, 2025

🌟 어떤 이유로 MR를 하셨나요?

  • feature 병합()
  • 버그 수정(아래에 issue #를 남겨주세요)
  • 코드 개선
  • 코드 수정
  • 배포
  • 기타(아래에 자세한 내용 기입해주세요)

📝 세부 내용 - 왜 해당 MR이 필요한지 작업 내용을 자세하게 설명해주세요

  • 리뷰/응원한 스토리가 없을 때 보이는 이미지/문구 작업 완료했습니다.
  • myPageDeatilPage 쪽 구조는 모두 작성해 두었으니 쿼리 작성 + 주석 해제하고 비슷하게 조건부 렌더링으로 구현하시면 됩니다!

📸 작업 화면 스크린샷

X

⚠️ MR하기 전에 확인해주세요

  • 로컬테스트를 진행하셨나요?
  • 머지할 브랜치를 확인하셨나요?
  • 관련 label을 선택하셨나요?

@dbstj0403 dbstj0403 requested a review from shroqkf May 19, 2025 10:13
@dbstj0403 dbstj0403 self-assigned this May 19, 2025
@dbstj0403 dbstj0403 added Feat Improvements or additions to documentation Design This doesn't seem right labels May 19, 2025
@vercel
Copy link

vercel bot commented May 19, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
morak ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 19, 2025 10:13am

@coderabbitai
Copy link

coderabbitai bot commented May 19, 2025

Walkthrough

이 변경사항은 "리뷰"와 "응원" 섹션에 빈 상태일 때를 위한 조건부 렌더링을 도입합니다. 데이터 배열이 비어 있거나 정의되지 않은 경우, 리스트 대신 플레이스홀더 UI와 안내 메시지를 표시합니다. 또한, 관련 SVG 이미지 임포트와 헤더 컨테이너에 마진이 추가되었습니다.

Changes

파일 경로 변경 요약
src/pages/myPageDetail/MyPageDetailPage.jsx 리뷰 및 응원 섹션에 빈 상태 조건부 렌더링 추가, noResult SVG 임포트, 리뷰 헤더에 마진(my-2) 적용

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.

✨ Finishing Touches
  • 📝 Generate Docstrings

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

🔭 Outside diff range comments (1)
src/pages/myPageDetail/MyPageDetailPage.jsx (1)

39-47: 🛠️ Refactor suggestion

"찜" 섹션에도 빈 상태 처리가 필요합니다.

"리뷰"와 "응원" 섹션에는 빈 상태 처리가 구현되었지만, "찜" 섹션에는 구현되지 않았습니다. 일관성을 위해 "찜" 섹션에도 동일한 패턴을 적용하세요.

다음과 같이 "찜" 섹션에도 조건부 렌더링을 추가하세요:

{kind === "찜" && (
  <div className="flex justify-between items-center px-5">
    <div className="flex gap-2 items-center">
      <img src={heart} className="w-8 h-8" />
      <p className="h3">저장한 장소</p>
    </div>
-   <p className="b5 text-gray-9">총 0개</p>
+   <p className="b5 text-gray-9">총 {heartsData?.length || 0}개</p>
  </div>
)}

// 그리고 이 부분에 heartsData에 대한 조건부 렌더링 추가
{kind === "찜" && (
  {heartsData?.length > 0 ? (
    heartsData.map((item) => (
      // 해당 데이터를 표시하는 컴포넌트
    ))
  ) : (
    <div className="flex flex-col justify-center items-center mt-36">
      <img src={noResult} />
      <p className="h4 text-gray-9 text-center py-8">
        아직 저장한 장소가
        <br /> 없어요
      </p>
    </div>
  )}
)}
🧹 Nitpick comments (4)
src/pages/myPageDetail/MyPageDetailPage.jsx (4)

62-74: 리뷰 섹션의 빈 상태 처리 구현 완료.

리뷰 데이터가 없을 때 사용자에게 적절한 피드백을 제공하는 조건부 렌더링이 잘 구현되었습니다.

Fragment가 불필요하게 사용되고 있습니다. 다음과 같이 Fragment를 제거하세요:

{kind === "리뷰" && (
-  <>
    {reviewsData?.length > 0 ? (
      reviewsData.map((item, idx) => (
        <ReviewItem data={item} key={idx} />
      ))
    ) : (
      <div className="flex flex-col justify-center items-center mt-36">
        <img src={noResult} />
        <p className="h4 text-gray-9 text-center py-8">
          아직 작성한 리뷰가
          <br /> 없어요
        </p>
      </div>
    )}
-  </>
)}

78-94: 응원 섹션의 빈 상태 처리 구현 완료.

응원 데이터가 없을 때 사용자에게 적절한 피드백을 제공하는 조건부 렌더링이 잘 구현되었습니다.

Fragment가 불필요하게 사용되고 있습니다. 다음과 같이 Fragment를 제거하세요:

{kind === "응원" && (
-  <>
    {cheersData?.length > 0 ? (
      cheersData.map((item) => (
        <StoryItem item={item} key={item.storyId} />
      ))
    ) : (
      <div className="flex flex-col justify-center items-center mt-36">
        <img src={noResult} />
        <p className="h4 text-gray-9 text-center py-8">
          아직 응원한 이야기가
          <br /> 없어요
        </p>
      </div>
    )}
-  </>
)}

62-94: 반복되는 코드 패턴을 컴포넌트로 분리하세요.

"리뷰"와 "응원" 섹션에서 빈 상태 UI가 반복되고 있습니다. 코드 재사용성과 유지보수를 위해 이 부분을 별도의 컴포넌트로 추출하는 것이 좋습니다.

다음과 같이 빈 상태를 위한 컴포넌트를 생성하고 사용하세요:

// EmptyState 컴포넌트 추가
const EmptyState = ({ message }) => (
  <div className="flex flex-col justify-center items-center mt-36">
    <img src={noResult} />
    <p className="h4 text-gray-9 text-center py-8">
      {message}
      <br /> 없어요
    </p>
  </div>
);

// 리뷰 섹션에서 사용
{kind === "리뷰" && (
  {reviewsData?.length > 0 ? (
    reviewsData.map((item, idx) => (
      <ReviewItem data={item} key={idx} />
    ))
  ) : (
    <EmptyState message="아직 작성한 리뷰가" />
  )}
)}

// 응원 섹션에서 사용
{kind === "응원" && (
  {cheersData?.length > 0 ? (
    cheersData.map((item) => (
      <StoryItem item={item} key={item.storyId} />
    ))
  ) : (
    <EmptyState message="아직 응원한 이야기가" />
  )}
)}
🧰 Tools
🪛 Biome (1.9.4)

[error] 63-81: Avoid using unnecessary Fragment.

A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment.
Unsafe fix: Remove the Fragment

(lint/complexity/noUselessFragments)


62-65: 인덱스 기반 키 사용을 재검토하세요.

reviewsData 배열을 렌더링할 때 배열 인덱스를 키로 사용하고 있습니다. 가능하다면, 아이템의 고유 식별자(ID)를 키로 사용하는 것이 React의 재조정 메커니즘에 더 적합합니다.

reviewsData 객체에 고유 ID가 있다면 다음과 같이 변경하세요:

-reviewsData.map((item, idx) => (
-  <ReviewItem data={item} key={idx} />
+reviewsData.map((item) => (
+  <ReviewItem data={item} key={item.id} />
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 12b844d and 73e23f1.

📒 Files selected for processing (1)
  • src/pages/myPageDetail/MyPageDetailPage.jsx (3 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
src/pages/myPageDetail/MyPageDetailPage.jsx

[error] 63-81: Avoid using unnecessary Fragment.

A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment.
Unsafe fix: Remove the Fragment

(lint/complexity/noUselessFragments)

🔇 Additional comments (2)
src/pages/myPageDetail/MyPageDetailPage.jsx (2)

8-8: SVG 가져오기 구현 완료.

빈 상태 UI를 위한 noResult SVG 파일을 성공적으로 가져왔습니다.


31-31: 마진 추가로 레이아웃 개선.

헤더 컨테이너에 수직 마진(my-2)을 추가하여 시각적 간격이 개선되었습니다.

@shroqkf shroqkf changed the title Feat: 리뷰/응원한 스토리 없을 때 보이는 페이지 구현 [Feat] 리뷰/응원한 스토리 없을 때 보이는 페이지 구현 May 19, 2025
@shroqkf shroqkf merged commit 94169cf into develop May 19, 2025
4 checks passed
@shroqkf shroqkf deleted the feature/logOfMypage branch May 19, 2025 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Design This doesn't seem right Feat Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants