Skip to content
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

feat: Generic table pagination #79

Merged
merged 5 commits into from
Mar 2, 2023

Conversation

karelianpie
Copy link
Member

@karelianpie karelianpie commented Feb 27, 2023

Description

Add pagination to the Table component

Design https://www.figma.com/file/4dy3zMjSCYA80iyNqgGHv9/veYFI-UI?node-id=1244%3A508&t=OA6qq5ek33Sm29zW-0

How Has This Been Tested?

Ran locally, refer to the screenshot below

Screenshots (if appropriate):

Screenshot 2023-02-27 at 13 28 55

@karelianpie karelianpie self-assigned this Feb 27, 2023
@vercel
Copy link

vercel bot commented Feb 27, 2023

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

Name Status Preview Comments Updated
yearnfi ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 2, 2023 at 7:41AM (UTC)

@karelianpie karelianpie changed the base branch from main to feat/veyfi-gauges February 27, 2023 11:34
@karelianpie karelianpie changed the title Feat/generic table pagination feat: Generic table pagination Feb 27, 2023
Copy link
Contributor

@xgambitox xgambitox left a comment

Choose a reason for hiding this comment

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

Would be nice if we can also handle either using pagination or not, for a table that doesnt require it

apps/common/components/Table.tsx Outdated Show resolved Hide resolved
apps/common/components/Table.tsx Outdated Show resolved Hide resolved
@karelianpie
Copy link
Member Author

Would be nice if we can also handle either using pagination or not, for a table that doesnt require it

Good point! Or a table with less than the max number of rows per page (i.e. min 2 pages for pagination to be enabled)

Will push a refactor first thing tomorrow morning :)

@xgambitox xgambitox merged commit 44aecf6 into feat/veyfi-gauges Mar 2, 2023
@xgambitox xgambitox deleted the feat/generic-table-pagination branch March 2, 2023 16:08
karelianpie added a commit that referenced this pull request Jun 20, 2023
* feat: Generic table pagination

* refactor: Styling

* refactor: Greyer caption

* refactor: Extract pagination to usePagination hook

* refactor: Separate usePagination from Pagination
Majorfi added a commit that referenced this pull request Aug 28, 2023
* feat: add delegate vote action

* feat: add address validation

* feat: add input common component

* feat: add gauge vote tab

* feat: add base gauge context

* feat: add gauge actions

* feat: add table common component

* feat: add gauge tab with mock data

* refactor: sort order states

* fix: table sizing

* fix: table header font size

* refactor: isNumber cast

* style: readability improvements

* refactor: input placeholder

* refactor: nullish coalescing

* refactor: sort numbers

* refactor: keyBy typing

* refactor: isString util

* style: remove unnecessary unknowns

* style: remove unnesessary cast

* refactor: replace mt for gap

* style: isNumberable better naming

* fix: gauge tab table span

* fix: update unstake interface changes

* feat: add gauge reward position

* feat: add gauge boost

* refactor: user positions not optional

* feat: add base generic dropdown component

* feat: add dropdown improvements

* feat: add base rewards tab UI

* feat: Generic table pagination (#79)

* feat: Generic table pagination

* refactor: Styling

* refactor: Greyer caption

* refactor: Extract pagination to usePagination hook

* refactor: Separate usePagination from Pagination

* feat: add base redeem tab

* feat: implement base gauge interactions

* feat: optional table pagination

* feat: implement base rewards functionality

* feat: update to latest actions interface

* feat: add base options context

* feat: add options allowance fetcher

* fix: use default provider

* refactor: use unique allowance ID

* feat: add dynamic required eth fetcher

* fix: new types directory

* feat: add option actions

* feat: add contexts to veyfi app wrapper

* feat: add base option redeem functionality

* feat: update contract abi

* feat: support bignumbers on tables

* feat: import contract ABIs

* feat: format gauge table columns

* feat: add option price calcs

* feat: add option price to views

* feat: update options contracts

* fix: gauge staking

* fix: calculate boost using fixed number

* fix: fetch next boost

* feat: display gauges with rewards only

* refactor: claim reward actions

* fix: option price fetcher

* fix: update redeem option interface

* fix: update gauge abi

* fix: allowance key changes

* fix: redeem action details

* refactor: BigNumber -> bigint

* fix: Expression

* feat: Migrate useGauge to wagmi

* refactor: Migrate useGauge to wagmi

* refactor: Use 1 for chain id

* feat: Migrate useOption to wagmi

* feat: Migrate RewardsTab to wagmi

* feat: Assert gauge addresses

* refactor: Use `isDisabled` rather than `disabled` prop

Co-authored-by: Major <90963895+Majorfi@users.noreply.github.com>

* @karelianpie @Majorfi refactor: Use `isDisabled` rather than `disabled` prop

Co-authored-by: Major <90963895+Majorfi@users.noreply.github.com>

* feat: Migrate RedeemTab to wagmi

* Update apps/veyfi/components/RedeemTab.tsx

Co-authored-by: Major <90963895+Majorfi@users.noreply.github.com>

* feat: Assert account address and amount

* feat: Migrate VoteTab to wagmi

* refactor: Assert all addresses

* feat: Migrate GaugesTab to wagmi

* fix: Remove commented out code

* fix: Import the correct assert

* refactor: Assert accountAddress

* Update _app.tsx (#259)

* fix: Typo (#260)

* fix: refresh stuff

* fix: image with fallback

* fix: wallet connect

* fix: disable wallet connect while waiting for v2 validation

* fix: wallet connect

* fix: upd style

* feat: clean files

* fix: chain

* fix: Use want symbol for Total Deposited (#261)

Co-authored-by: Major <90963895+Majorfi@users.noreply.github.com>

* fix: wallet

* fix: networks

* fix: add rpc

* fix: add rpc

* feat: update optimism networks

* fix: On Optimism it shows New on the list but 0 inside

* fix: hide cowswap solver on sidechains (#262)

* fix: opt

* fix: bump lib for iFrame fix

* refactor: Rename toWagmiProvider -> wagmiUtils

* refactor: Use viem instead of ethers

* refactor: Move formatBytes32String -> stringToHex

* feat: Add assert ethRequired

* refactor: Remove unnecessary fn, use approveERC20

* Cast to const

Co-authored-by: Major <90963895+Majorfi@users.noreply.github.com>

* refactor: Use cl()

* fix: Remove extra spaces

* fix: Make tailwind css literal

* refactor: Move all constants to the same file

* Add missing space

Co-authored-by: Major <90963895+Majorfi@users.noreply.github.com>

* fix: Formatting

Co-authored-by: Major <90963895+Majorfi@users.noreply.github.com>

* refactor: Convert fn to wagmi

* refactor: Use separate args rather than array

* fix: Use isDisabled prop

* refactor: Use cl, props in multiple lines

* refactor: Use cl

* refactor: Replace with a useAsync

* refactor: Convert async fn to usCallback

* feat: Use cl()

* feat: Fetch prices on mount

* feat: Add refreshPrice to the dep array

* refactor: Replace useSWR with useAsync

* refactor(useGauge): Replace useSWR with useAsync

* refactor: Remove unnecessary prop

* feat: Add button role

Co-authored-by: Major <90963895+Majorfi@users.noreply.github.com>

* feat: Add button role

Co-authored-by: Major <90963895+Majorfi@users.noreply.github.com>

* feat: Move usePagination to common hooks

* refactor: Remove `.toString()`

Co-authored-by: Major <90963895+Majorfi@users.noreply.github.com>

* refactor: Tailwindcss dynamic classnames

* feat: Add `gauge-voting` feature flag

* chore: Update CHANGELOG

---------

Co-authored-by: xgambitox <18649057+xgambitox@users.noreply.github.com>
Co-authored-by: Major <90963895+Majorfi@users.noreply.github.com>
Co-authored-by: Major <major@ycorpo.com>
Co-authored-by: murderteeth <89237203+murderteeth@users.noreply.github.com>
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