Skip to content

[#1252] Build ContributionPanel.tsx (reads from /projection)#1290

Merged
realproject7 merged 2 commits into
mainfrom
task/1252-contribution-panel
May 26, 2026
Merged

[#1252] Build ContributionPanel.tsx (reads from /projection)#1290
realproject7 merged 2 commits into
mainfrom
task/1252-contribution-panel

Conversation

@realproject7

Copy link
Copy Markdown
Owner

Summary

  • Rewrites ContributionPanel.tsx to fetch from /api/airdrop/projection?address=X (canonical v5 API)
  • Displays: spend (PLOT), qualified referrals, FC bonus status, multiplier, weighted spend, share %, projected share at all 4 milestone tiers (Bronze/Silver/Gold/Diamond)
  • Handles loading, error, 404 (no data), and connected states
  • Does NOT fetch /api/airdrop/points (deprecated) or /api/airdrop/referral-code (ReferralCTA's responsibility)
  • Mobile-first responsive grid layout

Version

1.36.0 → 1.37.0 (feature)

Closes #1252

🤖 Generated with Claude Code

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>
@vercel

vercel Bot commented May 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
plotlink Ignored Ignored May 26, 2026 9:49am

Request Review

@realproject7 realproject7 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@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 cancelled flag on unmount
  • 404 from projection → graceful "Buy PLOT to start" empty state
  • Diamond tier highlighted with accent color
  • Stat helper keeps the grid DRY
  • Share % computed client-side from weighted_spend / community_total

No issues found.

@project7-interns project7-interns left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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-typecheck fails 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 for react-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.

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 project7-interns left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@realproject7 realproject7 merged commit 1c8940a into main May 26, 2026
4 checks passed
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.

[T3.3] Build ContributionPanel.tsx (reads from /projection)

2 participants