Skip to content

Conversation

@dioo1461
Copy link
Contributor

@dioo1461 dioo1461 commented Feb 2, 2025

#️⃣ 연관된 이슈>

📝 작업 내용> 이번 PR에서 작업한 내용을 간략히 설명해주세요(이미지 첨부 가능)

Pagination 컴포넌트를 구현했습니다.
image

🙏 여기는 꼭 봐주세요! > 리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

Summary by CodeRabbit

  • New Features

    • Added a customizable dot icon component with flexible sizing and color options.
    • Introduced an enhanced pagination system featuring dynamic item rendering and improved navigation controls.
  • Documentation

    • Provided interactive examples showcasing pagination behavior with live adjustments.
  • Style

    • Updated pagination styling for a more consistent layout and improved user interaction.

@dioo1461 dioo1461 requested a review from hamo-o February 2, 2025 14:26
@dioo1461 dioo1461 added the 🖥️ FE Frontend label Feb 2, 2025
@dioo1461 dioo1461 added this to the Core 컴포넌트 개발 milestone Feb 2, 2025
Copy link
Contributor

@hamo-o hamo-o 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 74 to 78
currentPage - 2,
currentPage - 1,
currentPage,
currentPage + 1,
currentPage + 2,
Copy link
Contributor

Choose a reason for hiding this comment

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

p3; 이부분도 PAGE_LIMIT을 이용해서 표현할 수 있을 것 같습니다!

Copy link
Contributor Author

@dioo1461 dioo1461 Feb 3, 2025

Choose a reason for hiding this comment

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

이부분은 currentPage에 종속적인 부분이라 (currentPage 포함 앞뒤 2개씩 가운데 부분에 렌더링)
image

저로서는 PAGE_LIMIT으로 표현할 방법이 떠오르지 않는데, 혹시 다르게 생각하신 부분이 있다면 알려주시면 감사하겠습니다!

  • 이해한 것 같습니다, 곧 반영하겠습니다!

@coderabbitai
Copy link

coderabbitai bot commented Feb 3, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request adds several new components and updates related to iconography and pagination. A new React functional component for an icon (IconDotsMono) is created and exported. Additionally, a new pagination mechanism is introduced including a main Pagination component with dynamic item calculation, a supporting PaginationItem component for page or separator rendering, and associated styles. A Storybook configuration for the Pagination component has also been added to facilitate interactive testing and documentation.

Changes

File(s) Change Summary
frontend/src/components/Icon/component/IconDotsMono.tsx
frontend/src/components/Icon/index.ts
Added new IconDotsMono component with customizable props and corresponding export for module accessibility.
frontend/src/components/Pagination/Pagination.stories.tsx Introduced a Storybook story for the Pagination component with adjustable props and interactive controls.
frontend/src/components/Pagination/PaginationItem.tsx Added new PaginationItem component with types for rendering page numbers or separator icons, including click handling.
frontend/src/components/Pagination/index.css.ts Defined new pagination styles using vanilla-extract for container layout, item styling (including hover and selected states), and dot containers.
frontend/src/components/Pagination/index.tsx Added a main Pagination component implementing pagination logic, a helper function to generate items, state management, and exports for pagination functionality including a separator constant.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant P as Pagination
    participant G as getPaginationItems
    participant PI as PaginationItem
    participant I as IconDotsMono

    U->>P: Open Pagination view
    P->>G: Calculate pagination items (currentPage, totalPages)
    G-->>P: Return list of page numbers & separators
    P->>PI: Render PaginationItem for each item
    alt Item is Separator
        PI->>I: Render IconDotsMono for dot display
    end
    U->>PI: Click on a PaginationItem
    PI->>P: Trigger onPageChange with selected page
    P-->>U: Update pagination view and highlight new page
Loading

Poem

I'm a little rabbit, hopping with glee,
In new components and functions, I now see.
Icons dance in the SVG light,
Pagination pages shining bright.
Code carrots crunch in every line,
Celebrating changes so clean and fine!
🐰🥕 Happy coding, all is divine!


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9eb2130 and 56580f4.

⛔ Files ignored due to path filters (1)
  • frontend/src/components/Icon/svg/icon-dots-mono.svg is excluded by !**/*.svg
📒 Files selected for processing (6)
  • frontend/src/components/Icon/component/IconDotsMono.tsx (1 hunks)
  • frontend/src/components/Icon/index.ts (1 hunks)
  • frontend/src/components/Pagination/Pagination.stories.tsx (1 hunks)
  • frontend/src/components/Pagination/PaginationItem.tsx (1 hunks)
  • frontend/src/components/Pagination/index.css.ts (1 hunks)
  • frontend/src/components/Pagination/index.tsx (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

🪧 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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. (Beta)
  • @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.

@dioo1461 dioo1461 merged commit 750c466 into dev Feb 3, 2025
1 check was pending
@dioo1461 dioo1461 self-assigned this Feb 5, 2025
@dioo1461 dioo1461 deleted the feature/fe/pagination-component branch February 6, 2025 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🖥️ FE Frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants