feat: support reward table & rank table#5637
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryImplements the Prime Leaderboard
Confidence Score: 4/5The pagination changes are safe to merge; all new components use placeholder data with explicit TODO markers before real API wiring lands. The main concern is that both
Important Files Changed
|
| // Automatically set default page param if none was set | ||
| useEffect(() => { | ||
| if (urlPageParam === undefined) { | ||
| setSearchParams({ | ||
| [PAGE_PARAM_KEY]: '1', | ||
| }); | ||
| setPageParam('1'); | ||
| } | ||
| }, [urlPageParam, setSearchParams]); | ||
| }, [urlPageParam, setPageParam]); |
There was a problem hiding this comment.
The auto-initialisation effect checks for
undefined but searchParams.get() returns null for a missing key, so this condition is always false. Switching to === null makes the intent explicit and ensures the guard works without relying on the paired useUrlPagination hook.
| // Automatically set default page param if none was set | |
| useEffect(() => { | |
| if (urlPageParam === undefined) { | |
| setSearchParams({ | |
| [PAGE_PARAM_KEY]: '1', | |
| }); | |
| setPageParam('1'); | |
| } | |
| }, [urlPageParam, setSearchParams]); | |
| }, [urlPageParam, setPageParam]); | |
| // Automatically set default page param if none was set | |
| useEffect(() => { | |
| if (urlPageParam === null) { | |
| setPageParam('1'); | |
| } | |
| }, [urlPageParam, setPageParam]); |
There was a problem hiding this comment.
Same pattern as ProposalList/VoterLeaderboard. Page init is handled by useUrlPagination, so this is harmless. Reworking the shared hook is out of scope.
| { | ||
| key: 'uRewards', | ||
| label: t('primeLeaderboard.rewardTable.columns.marketRewards', { symbol: 'U' }), | ||
| selectOptionLabel: t('primeLeaderboard.rewardTable.columns.marketRewards', { symbol: 'U' }), | ||
| align: 'right', | ||
| sortRows: (rowA, rowB, direction) => | ||
| direction === 'asc' | ||
| ? rowA.uRewardsCents - rowB.uRewardsCents | ||
| : rowB.uRewardsCents - rowA.uRewardsCents, | ||
| renderCell: ({ uRewardsCents }) => ( | ||
| <span className="text-b1r text-white"> | ||
| {formatCentsToReadableValue({ value: uRewardsCents })} | ||
| </span> | ||
| ), |
There was a problem hiding this comment.
Placeholder token symbol
'U' is ambiguous
The market column is rendered with symbol: 'U', which is not a recognisable token symbol. When the API integration lands, the columns will need to be generated dynamically from the list of markets that distribute Prime rewards; hardcoding even placeholder symbols like 'U' makes it easy to ship this into production without replacing the placeholder. Consider using 'XVS' or another real Prime-eligible token symbol so the placeholder is visually representative, and add a note that the column list must come from the API.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Coverage Report for ./apps/evm
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
e6cf09b to
7b2c2d9
Compare
Jira ticket(s)
VPD-1335
VPD-1336
Changes