feat: support prime leaderboard user rank card#5638
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR adds the Prime Leaderboard user rank card, including a connected/disconnected state, eligibility messaging, a Rules modal, and a "Stake XVS" flow that reuses the shared
Confidence Score: 5/5Safe to merge — all new UI is behind the existing primeLeaderboard feature flag and the hardcoded placeholder data is intentional for testnet. All changes are additive and feature-flagged. The hardcoded placeholder data in useGetPrimeRank (rank, score, eligibility) was confirmed as intentional testnet mock data in a prior thread. No real user balances or transactions are affected by the placeholder values. The VenusVaultModal refactor is a pure rename/move with no behavioural change. Tests cover the new components, and i18n strings are complete and consistent across all seven locales. apps/evm/src/containers/PrimeRank/useGetPrimeRank/index.ts — contains hardcoded placeholder values that will need to be replaced with real API data before the feature goes live on mainnet. Important Files Changed
Reviews (3): Last reviewed commit: "feat: support prime rank card" | Re-trigger Greptile |
| | undefined; | ||
|
|
||
| if (!xvsVault) { | ||
| return null; | ||
| } |
There was a problem hiding this comment.
Silent null return during vault data loading
When a user clicks "Stake XVS" before useGetVaults has finished fetching (e.g., on initial page load), vaults will be an empty array and xvsVault will be undefined. The component returns null, so VenusVaultModal is never rendered — the modal simply doesn't appear with no loading indicator or error feedback. Consider rendering a loading spinner (or keeping the VenusVaultModal with a skeleton) while the vault data is in flight so users understand the action was registered.
| const placeholderRankData: PrimeRankData = { | ||
| hasStakedXvs: true, | ||
| isCandidate: true, | ||
| isPrime: true, | ||
| hasSupplied: true, | ||
| rank: 2, | ||
| primeScore: 542_500_000, | ||
| gapXvsTokens: 5_432, | ||
| }; | ||
|
|
||
| export const useGetPrimeRank = (): PrimeRankData => placeholderRankData; |
There was a problem hiding this comment.
Hardcoded placeholder visible to all connected users
Every connected user who visits the Prime Leaderboard will see rank #2, score 542.5M, and the congratulatory "Congrats! You're in the Top 500 during last cycle and qualified for Prime Rewards." message because isPrime: true, hasSupplied: true, and isCandidate: true are hardcoded. This data feeds into both RankSection (the leaderboard page card) and the Footer shown inside the VenusVaultModal stake tab (when primeLeaderboard feature flag is on). If the feature flag for the page or the modal footer is enabled before the API integration lands, users will see completely incorrect eligibility status and rank numbers.
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!
There was a problem hiding this comment.
mock data for testnet
30026a2 to
4cd7e90
Compare
b08e94a to
9bfb2b4
Compare
9bfb2b4 to
b2440a8
Compare
c60f5ff to
bd2ecf9
Compare
|
@greptile review again |
1 similar comment
|
@greptile review again |
Jira ticket(s)
VPD-1332
Changes
VenusVaultModalwith a Prime rank footer.