Skip to content

[Bug] PR #201 writer dashboard: duplicate donations, royalties misplaced, tiny amounts hidden #210

@realproject7

Description

@realproject7

Problem

PR #201 ([#194]) introduced regressions in the writer dashboard storyline cards:

1. Donations duplicated

The top-level 3-column grid (Plots / Created / Donations) already shows donations via DonationCount.
But WriterTradingStats also renders a "Donations" column as its first item.
Fix: Remove the Donations column from WriterTradingStats.tsx — it should only show Token Price and TVL (2-col grid or keep 3-col with something else).

2. Royalties in wrong location

Currently ClaimRoyalties renders as a separate block below WriterTradingStats.
Fix: Royalties should appear on the bottom-left of the card, integrated into the stats area. When unclaimed > 0, the amount text should be green (text-accent), not default color.

3. Tiny royalty amounts show as "0 WETH"

formatUnits with 18 decimals truncates tiny values like 324500000000 wei (0.0000003245 WETH) to "0".
Fix: Use the formatTruncated helper (already in WriterTradingStats.tsx) with enough decimal digits (e.g. 10) to display tiny amounts. Never show "0" when the actual value is nonzero.

4. Claim button disconnected from royalties

The Claim button is on the far right, visually separated from the royalty amount.
Fix: Place the Claim button directly below or immediately next to the royalty amount, not on the opposite side of the card.

Files

  • src/components/WriterTradingStats.tsx — remove duplicate Donations column
  • src/components/ClaimRoyalties.tsx — fix tiny amount display (use formatTruncated), adjust layout so claim button is adjacent to royalty amount, green text when > 0
  • src/app/dashboard/writer/page.tsx — may need layout adjustment for royalties placement

Acceptance Criteria

  • Donations appear only once per card (in the top grid)
  • WriterTradingStats shows Token Price + TVL (no Donations)
  • Royalty amount displays in green when > 0, shows full precision for tiny amounts (never "0" when nonzero)
  • Claim button is visually adjacent to royalty amount (below or inline-right)
  • No regressions in ClaimRoyalties tooltip or disabled state logic

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions