-
Notifications
You must be signed in to change notification settings - Fork 3
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(PGIO-137): add pagination to My Bets #153
base: main
Are you sure you want to change the base?
Conversation
Deploying presagio with
|
Latest commit: |
7b6442e
|
Status: | ✅ Deploy successful! |
Preview URL: | https://258e69d0.presagio.pages.dev |
Branch Preview URL: | https://feat-pgio-137-add-pagination.presagio.pages.dev |
Design wise, let's move the pagination bellow, it's cleaner. Even tho I know it can be a lot of elements, will probably add search bet on that page at some point in the future. |
…he search params cleanup and condition to display the pagination controls
…r readability purposes
app/(main)/profile/page.tsx
Outdated
@@ -37,13 +37,27 @@ import { useEnsName } from 'wagmi'; | |||
import { mainnetConfigForENS } from '@/providers/chain-config'; | |||
import { mainnet } from 'viem/chains'; | |||
|
|||
import { AiAgent } from '@/types'; | |||
|
|||
const ITEMS_PER_PAGE = 100; |
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.
Why 100 items? Can we show 10 per page? I see that all bets depends on this number, maybe we can fix the "all bets number problem" in another PR
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.
Yeah, all the filters depends on the "All Bets", and the "All Bets" is the result from getting the query result from The Graph and then applying a filter in the FE, so our simulated pagination sometimes behave in an odd way.
Anyway, the other tabs are filters, so they'll never be > All bets
app/(main)/my-bets/page.tsx
Outdated
import { TabBody, TabGroup, TabHeader } from '@swapr/ui'; | ||
import { useAccount } from 'wagmi'; | ||
import { BetsListPanel, BetsListTab } from '@/app/components'; | ||
import { useRouter } from 'next/navigation'; | ||
|
||
const ITEMS_PER_PAGE = 50; |
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.
Can we show 10 items per page?
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.
why 10?
Seems low, at least 25 would be good.
Fixes: PGIO-137
Description
skip
andfirst
parameters (needed to emulate pagination)<Pagination />
component, implements the new component where neededVisual Evidence
https://www.loom.com/share/c2034270a73945299d6129d711c513af?sid=e8f0bafe-7e3f-4fd6-b0cb-1495ec27b871