flowbite-react icon indicating copy to clipboard operation
flowbite-react copied to clipboard

feat: create TableHeadRow component

Open raky291 opened this issue 1 year ago • 6 comments

Summarize the changes made and the motivation behind them.

Reference related issues using # followed by the issue number.

If there are breaking API changes - like adding or removing props, or changing the structure of the theme - describe them, and provide steps to update existing code.


https://github.com/themesberg/flowbite-react/issues/1467

Please review my code, I'm not sure if I need to modify more code. Regards.

Summary by CodeRabbit

  • New Features

    • Introduced HeadRow to the Table component for improved header row control.
    • Added a new TableHeadRow component for enhanced customization of table header rows.
  • Improvements

    • Enhanced theming capabilities of table headers with a new row property for better style customization.
    • Improved structural organization of table headers through the use of TableHeadRow in tests.
    • Updated contribution guidelines to include a new step for creating changesets before pull requests.

raky291 avatar Aug 16 '24 16:08 raky291

🦋 Changeset detected

Latest commit: 4cd398122708ad2b1af3bdf49a088ac4089ec137

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
flowbite-react Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Aug 16 '24 16:08 changeset-bot[bot]

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

Name Status Preview Comments Updated (UTC)
flowbite-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 28, 2024 3:28pm
flowbite-react-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 28, 2024 3:28pm

vercel[bot] avatar Aug 16 '24 16:08 vercel[bot]

Walkthrough

The recent changes introduce a new HeadRow export in the Table API, enhancing the flexibility of the table header structure. The FlowbiteTableHeadTheme interface is updated for greater customization, while a new TableHeadRow component is created to streamline rendering of header rows. Additionally, the TestTable component is modified to utilize the new Table.HeadRow, promoting a more structured approach to table headers.

Changes

Files Change Summary
packages/ui/src/components/Table/Table.tsx Added a new export, HeadRow, to enhance the Table component's API.
packages/ui/src/components/Table/TableHead.tsx Introduced a row property to the FlowbiteTableHeadTheme interface for improved theming flexibility; removed wrapping <tr> element.
packages/ui/src/components/Table/TableHeadRow.tsx Created TableHeadRow component with ref forwarding, customizable theming, and improved handling of props and class names.
packages/ui/src/components/Table/Table.spec.tsx Updated TestTable to replace Table.Head with Table.HeadRow, enhancing semantic organization of the table header.

Poem

🐰 In fields of green, I hop with glee,
A HeadRow joins the Table spree!
With themes that dance and rows that shine,
Our tables now are truly divine!
Let's celebrate this change, oh what a sight,
A rabbit's joy in the coding light! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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.

coderabbitai[bot] avatar Aug 16 '24 16:08 coderabbitai[bot]

@raky291 this looks good, but I think that we will introduce some breaking changes. Can you just adjust the PR and maybe the commit to inform it? - this kind of information is added to the release notes/changelog. :)

rluders avatar Aug 21 '24 07:08 rluders

@rluders Thank you for checking my PR, I have already uploaded my changes and added the changeset, I also added some changes to CONTRIBUTING.md I hope that is okay. Greetings.

raky291 avatar Aug 28 '24 05:08 raky291

@raky291 could you please just revert this https://github.com/themesberg/flowbite-react/pull/1470/commits/0ffc988f3c5df93f44de363e026f10eaa6ca6b8b and instead of using merge use rebase?

After reverting, inside your branch:

git pull origin main --rebase

rluders avatar Aug 28 '24 07:08 rluders

This needs a re-sync with the main branch + fix conflicts

SutuSebastian avatar Mar 26 '25 11:03 SutuSebastian