Skip to content

Conversation

@jackburrus
Copy link
Contributor

@jackburrus jackburrus commented Oct 13, 2023

This PR adds filtering and sorting to the transactions table

Screen.Recording.2023-10-12.at.6.38.18.PM.mov

@vercel
Copy link

vercel bot commented Oct 13, 2023

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

Name Status Preview Comments Updated (UTC)
hyperdrive-fixed-borrow ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 13, 2023 1:54am
hyperdrive-monorepo-hyperdrive-trading ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 13, 2023 1:54am
hyperdrive-sdk-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 13, 2023 1:54am

Copy link
Contributor

@DannyDelott DannyDelott left a comment

Choose a reason for hiding this comment

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

Sweet!

Comment on lines 112 to 128
<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>
Copy link
Contributor

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

Comment on lines 95 to 100
{...{
className: header.column.getCanSort()
? "cursor-pointer select-none flex gap-2 items-center"
: "",
onClick: header.column.getToggleSortingHandler(),
}}
Copy link
Contributor

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()}>

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants