-
Couldn't load subscription status.
- Fork 4
Adds filtering and sorting #429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sweet!
| <div className="flex gap-2"> | ||
| {["All", "Long", "Short"].map((filter) => ( | ||
| <button | ||
| key={filter} | ||
| className={`${ | ||
| header.column.getFilterValue() !== filter | ||
| ? "text-base-300/30" | ||
| : "" | ||
| }`} | ||
| onClick={() => | ||
| header.column.setFilterValue(filter) | ||
| } | ||
| > | ||
| {filter} | ||
| </button> | ||
| ))} | ||
| </div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Let's use daisy-tabs https://daisyui.com/components/tab/#tabs
| {...{ | ||
| className: header.column.getCanSort() | ||
| ? "cursor-pointer select-none flex gap-2 items-center" | ||
| : "", | ||
| onClick: header.column.getToggleSortingHandler(), | ||
| }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor nit: no need for the object spread
<div
className={classNames({
"cursor-pointer select-none flex gap-2 items-center": header.column.getCanSort(),
})}
onClick={header.column.getToggleSortingHandler()}>
This PR adds filtering and sorting to the transactions table
Screen.Recording.2023-10-12.at.6.38.18.PM.mov