You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ClaimRoyalties component (src/components/ClaimRoyalties.tsx) needs UX improvements for post-claim state and royalty history display.
Currently after claiming:
The button shows "Claimed X WETH" but stays green/active — should go inactive
The tx link is shown but the balance display doesn't immediately reflect 0
No historical "total claimed" info shown
The contract's getRoyaltyInfo(wallet, reserveToken) already returns both (balance, claimed) — we have access to the cumulative claimed amount without any extra calls.
Tasks
1. Post-claim success state
After a successful claim:
Balance display should show 0 WETH (refetch already happens, but ensure UI reflects it)
Claim button should be disabled with text "Claimed" (not clickable)
Show success message with clickable tx link to BaseScan, e.g.: Claimed 0.0001 WETH — tx: 0xabc...def
Clicking "Claimed" button or waiting for next refetch cycle should reset to idle state showing the updated (zero) balance
Display total claimed amount alongside unclaimed, e.g.: ROYALTIES: 0 WETH (claimed: 0.0001 WETH so far)
Only show the "claimed so far" portion if claimed > 0 — don't clutter the UI when nothing has been claimed yet
Files to Change
src/components/ClaimRoyalties.tsx — main component
Current getRoyaltyInfo call (line 42-47)
The query already reads from getRoyaltyInfo(beneficiary, PLOT_TOKEN) which returns [balance, claimed]. Currently only balance is used. Destructure both values:
Context
The ClaimRoyalties component (
src/components/ClaimRoyalties.tsx) needs UX improvements for post-claim state and royalty history display.Currently after claiming:
The contract's
getRoyaltyInfo(wallet, reserveToken)already returns both(balance, claimed)— we have access to the cumulative claimed amount without any extra calls.Tasks
1. Post-claim success state
After a successful claim:
0 WETH(refetch already happens, but ensure UI reflects it)Claimed 0.0001 WETH — tx: 0xabc...def2. Show cumulative claimed royalties
claimedvalue fromgetRoyaltyInfo(second return value — already available in the ABI after PR [#321] Fix SDK royalty ABI/client and web app MCV2 ABI accuracy #326 fix)ROYALTIES: 0 WETH (claimed: 0.0001 WETH so far)claimed > 0— don't clutter the UI when nothing has been claimed yetFiles to Change
src/components/ClaimRoyalties.tsx— main componentCurrent getRoyaltyInfo call (line 42-47)
The query already reads from
getRoyaltyInfo(beneficiary, PLOT_TOKEN)which returns[balance, claimed]. Currently onlybalanceis used. Destructure both values:Acceptance Criteria
npm run buildandnpm run typecheckpass