[#1252] Build ContributionPanel.tsx (reads from /projection)#1290
Conversation
Displays spend, qualified refs, FC bonus status, multiplier, weighted spend, share %, and projected share at all 4 milestone tiers. Single fetch to /api/airdrop/projection. Handles loading, error, and no-data states. Does not fetch /points (deprecated) or /referral-code (ReferralCTA's responsibility). Closes #1252 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
realproject7
left a comment
There was a problem hiding this comment.
@re2 review — APPROVE ✅
Checked against issue #1252 acceptance criteria:
| Criterion | Status |
|---|---|
| Displays spend, refs, FC bonus, multiplier, weighted spend, share %, projections | ✅ |
Reads from canonical /projection endpoint only |
✅ |
Does NOT fetch deprecated /points or /referral-code |
✅ |
| Loading + error + 404 states handled | ✅ |
| FC bonus indicator (Active/Not Active with accent) | ✅ |
| Projections at all 4 tiers (Bronze/Silver/Gold/Diamond) | ✅ |
| Mobile-first responsive grid | ✅ |
| Version 1.36.0 → 1.37.0 (feature) | ✅ |
Code notes:
- Proper cleanup with
cancelledflag on unmount - 404 from projection → graceful "Buy PLOT to start" empty state
- Diamond tier highlighted with accent color
Stathelper keeps the grid DRY- Share % computed client-side from weighted_spend / community_total
No issues found.
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: REQUEST CHANGES
Summary
The component reads the canonical /api/airdrop/projection endpoint and matches the response shape, but the latest head does not pass required checks.
Findings
- [high]
lint-and-typecheckfails on the latest head.- File:
src/components/airdrop/ContributionPanel.tsx:37 - The new effect performs synchronous state writes (
setLoading(false),setLoading(true),setError(null)) directly in the effect body. This repo has the React hooks lint rule enabled forreact-hooks/set-state-in-effect; the check is failing on PR #1290. - Suggestion: derive the initial loading state from
isConnected/address, or collapse the request into a keyed async result state so the effect only sets state from async callbacks/cleanup-safe paths.
- File:
Decision
Requesting changes until lint-and-typecheck passes. e2e was still pending when the lint failure appeared.
Replace separate data/loading/error states with single fetchState object. Only setState call in effect is in async fetch callbacks. Derive loading from fetchState.done + isConnected. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
The requested lint blocker is resolved, and the component now reads the canonical /api/airdrop/projection response to display spend, referrals, FC bonus, multiplier, weighted spend, share, and all four milestone projections.
Findings
- None blocking.
Decision
Approving PR #1290. The ContributionPanel behavior matches #1252, avoids the deprecated /points and referral-code fetches, and latest CI is green.
Summary
ContributionPanel.tsxto fetch from/api/airdrop/projection?address=X(canonical v5 API)/api/airdrop/points(deprecated) or/api/airdrop/referral-code(ReferralCTA's responsibility)Version
1.36.0 → 1.37.0 (feature)
Closes #1252
🤖 Generated with Claude Code