diff --git a/src/app/profile/[address]/page.tsx b/src/app/profile/[address]/page.tsx index 94451c88..e5c9d676 100644 --- a/src/app/profile/[address]/page.tsx +++ b/src/app/profile/[address]/page.tsx @@ -677,44 +677,50 @@ function StoriesTab({ return (
- {/* Writer Stats — compact horizontal row */} -
-
- Writer - {storylines.length} - stories - · - {totalPlots} - plots - · - {totalHolders !== undefined ? totalHolders : "—"} - holders - · - {totalDonations > BigInt(0) ? ( - <> - {formatPrice(formatUnits(totalDonations, 18))} {RESERVE_LABEL} - {plotUsd != null && ( - (≈ {formatUsdValue(Number(formatUnits(totalDonations, 18)) * plotUsd)}) - )} - - ) : ( - - )} - donated + {/* Writer Stats — structured grid */} +
+

Writer Stats

+
+
+ Stories + {storylines.length} +
+
+ Plots + {totalPlots} +
+
+ Holders + {totalHolders !== undefined ? totalHolders : "—"} +
+
+ Views + + {storylines.reduce((sum, s) => sum + (s.view_count ?? 0), 0)} + +
+
+
+ Donated + + {totalDonations > BigInt(0) + ? `${formatPrice(formatUnits(totalDonations, 18))} ${RESERVE_LABEL}` + : "—"} + {totalDonations > BigInt(0) && plotUsd != null && ( + ({formatUsdValue(Number(formatUnits(totalDonations, 18)) * plotUsd)}) + )} + {isOwnProfile && royaltyInfo && ( <> - · - {royaltyInfo.unclaimed > BigInt(0) ? ( - <> - {formatPrice(formatUnits(royaltyInfo.unclaimed, 18))} {RESERVE_LABEL} - {plotUsd != null && ( - (≈ {formatUsdValue(Number(formatUnits(royaltyInfo.unclaimed, 18)) * plotUsd)}) - )} - - ) : ( - - )} - claimable + Claimable + + {royaltyInfo.unclaimed > BigInt(0) + ? `${formatPrice(formatUnits(royaltyInfo.unclaimed, 18))} ${RESERVE_LABEL}` + : "—"} + {royaltyInfo.unclaimed > BigInt(0) && plotUsd != null && ( + ({formatUsdValue(Number(formatUnits(royaltyInfo.unclaimed, 18)) * plotUsd)}) + )} + )}
@@ -823,68 +829,67 @@ function StoryRow({ }); return ( -
- {/* Primary: title + badges + price */} -
+
+ {/* Title section */} +
{storyline.title} - {storyline.genre && ( - - {storyline.genre} - - )} - {storyline.sunset ? ( - complete - ) : ( - active - )} - {priceInfo && ( - - {formatPrice(priceInfo.pricePerToken)} {RESERVE_LABEL} - {plotUsd != null && ( - (≈ {formatUsdValue(Number(priceInfo.pricePerToken) * plotUsd)}) - )} - - )} -
- - {/* Secondary: compact stats */} -
- {storyline.plot_count} {storyline.plot_count === 1 ? "plot" : "plots"} - · - {holderCount !== undefined ? `${holderCount} ${holderCount === 1 ? "holder" : "holders"}` : "—"} - · - {formatViewCount(storyline.view_count)} views - {storyline.block_timestamp && ( - <> - · - {new Date(storyline.block_timestamp).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" })} - - )} +
+ {storyline.genre && {storyline.genre}} + {storyline.sunset ? ( + complete + ) : ( + active + )} +
- {/* TVL + donations */} - {storyline.token_address && ( -
+ {/* Stats grid */} +
+ {storyline.token_address && ( - + )} +
+
+ Plots + {storyline.plot_count} +
+
+ Holders + {holderCount ?? "—"} +
+
+ Views + {formatViewCount(storyline.view_count)} +
+
+ Created + + {storyline.block_timestamp + ? new Date(storyline.block_timestamp).toLocaleDateString("en-US", { month: "short", year: "2-digit" }) + : "—"} + +
- )} + {storyline.token_address && ( + + )} +
{/* Deadline */} {!storyline.sunset && storyline.last_plot_time && ( -
+
)} - {/* Owner-only: genre edit, royalties, donation history */} + {/* Genre prompt — own profile */} {isOwnProfile && !storyline.genre && ( -
+
)} + + {/* Royalties + Claim — own profile */} {isOwnProfile && storyline.token_address && ( -
+
)} + + {/* Donation history — own profile */} {isOwnProfile && storyline.token_address && ( - +
+ +
)}
); @@ -1133,19 +1144,24 @@ function StoryDonationCount({ storylineId, tokenAddress }: { storylineId: number }); if (!data || data.count === 0) { - return
No donations
; + return ( +
+ Donations + +
+ ); } return ( -
- Donations - +
+ Donations + {formatPrice(formatUnits(data.total, 18))} {RESERVE_LABEL} + {plotUsd != null && ( + ({formatUsdValue(Number(formatUnits(data.total, 18)) * plotUsd)}) + )} + ×{data.count} - {plotUsd != null && ( - (≈ {formatUsdValue(Number(formatUnits(data.total, 18)) * plotUsd)}) - )} - ({data.count})
); } diff --git a/src/components/WriterTradingStats.tsx b/src/components/WriterTradingStats.tsx index 3837d004..09cba282 100644 --- a/src/components/WriterTradingStats.tsx +++ b/src/components/WriterTradingStats.tsx @@ -43,32 +43,24 @@ export function WriterTradingStats({ storyline, plotUsd }: WriterTradingStatsPro }); return ( -
-
- - Token Price - - +
+
+ Price + {data ? `${formatPrice(data.price)} ${RESERVE_LABEL}` : "—"} + {data && plotUsd && ( + ({formatUsdValue(parseFloat(data.price) * plotUsd)}) + )} - {data && plotUsd && ( - - (≈ {formatUsdValue(parseFloat(data.price) * plotUsd)}) - - )}
-
- - TVL - - +
+ TVL + {data ? `${formatPrice(data.tvl)} ${RESERVE_LABEL}` : "—"} + {data && plotUsd && ( + ({formatUsdValue(parseFloat(data.tvl) * plotUsd)}) + )} - {data && plotUsd && ( - - (≈ {formatUsdValue(parseFloat(data.tvl) * plotUsd)}) - - )}
);