diff --git a/src/app/profile/[address]/page.tsx b/src/app/profile/[address]/page.tsx index 71101cc4..2276c517 100644 --- a/src/app/profile/[address]/page.tsx +++ b/src/app/profile/[address]/page.tsx @@ -477,6 +477,9 @@ function ProfileHeader({ {claimedRoyalties != null && claimedRoyalties > BigInt(0) && (
Royalties: {formatPrice(formatUnits(claimedRoyalties, 18))} {RESERVE_LABEL} + {plotUsdPrice != null && ( + (≈ {formatUsdValue(Number(formatUnits(claimedRoyalties, 18)) * plotUsdPrice)}) + )}
)} @@ -704,14 +707,14 @@ function StoriesTab({ BigInt(0) - ? `${formatPrice(formatUnits(totalDonations, 18))} ${RESERVE_LABEL}` + ? `${formatPrice(formatUnits(totalDonations, 18))} ${RESERVE_LABEL}${plotUsd != null ? ` (≈ ${formatUsdValue(Number(formatUnits(totalDonations, 18)) * plotUsd)})` : ""}` : "—"} /> {isOwnProfile && royaltyInfo && ( BigInt(0) - ? `${formatPrice(formatUnits(royaltyInfo.unclaimed, 18))} ${RESERVE_LABEL}` + ? `${formatPrice(formatUnits(royaltyInfo.unclaimed, 18))} ${RESERVE_LABEL}${plotUsd != null ? ` (≈ ${formatUsdValue(Number(formatUnits(royaltyInfo.unclaimed, 18)) * plotUsd)})` : ""}` : "—"} /> )} @@ -862,7 +865,7 @@ function StoryRow({ {priceInfo - ? `${formatPrice(priceInfo.pricePerToken)} ${RESERVE_LABEL}` + ? `${formatPrice(priceInfo.pricePerToken)} ${RESERVE_LABEL}${plotUsd != null ? ` (≈ ${formatUsdValue(Number(priceInfo.pricePerToken) * plotUsd)})` : ""}` : "—"} @@ -1031,6 +1034,7 @@ function GenrePrompt({ const DONATION_PAGE_SIZE = 10; function ProfileDonationHistory({ storylineId }: { storylineId: number }) { + const { data: plotUsd } = usePlotUsdPrice(); const { data, isFetchingNextPage, @@ -1094,6 +1098,9 @@ function ProfileDonationHistory({ storylineId }: { storylineId: number }) { {formatPrice(formatUnits(BigInt(d.amount), 18))} {RESERVE_LABEL} + {plotUsd != null && ( + (≈ {formatUsdValue(Number(formatUnits(BigInt(d.amount), 18)) * plotUsd)}) + )} {d.tx_hash && ( { @@ -1149,7 +1157,7 @@ function StoryDonationCount({ storylineId, tokenAddress }: { storylineId: number return ( - {formatPrice(formatUnits(data.total, 18))} {RESERVE_LABEL} ({data.count}) + {formatPrice(formatUnits(data.total, 18))} {RESERVE_LABEL}{plotUsd != null && ` (≈ ${formatUsdValue(Number(formatUnits(data.total, 18)) * plotUsd)})`} ({data.count}) ); } @@ -1437,10 +1445,16 @@ function PortfolioTab({ address, isOwnProfile }: { address: string; isOwnProfile Price: {formatPrice(formatUnits(h.price, 18))} {RESERVE_LABEL} + {plotUsd != null && ( + (≈ {formatUsdValue(Number(formatUnits(h.price, 18)) * plotUsd)}) + )} {h.entryPrice !== null && h.entryPrice > 0 && ( Entry: {formatPrice(h.entryPrice)} {RESERVE_LABEL} + {plotUsd != null && ( + (≈ {formatUsdValue(h.entryPrice * plotUsd)}) + )} )} {h.lastTraded && ( @@ -1468,6 +1482,9 @@ function PortfolioTab({ address, isOwnProfile }: { address: string; isOwnProfile {formatPrice(formatUnits(donationsReceived!.total, 18))} {RESERVE_LABEL} + {plotUsd != null && ( + (≈ {formatUsdValue(Number(formatUnits(donationsReceived!.total, 18)) * plotUsd)}) + )} from {donationsReceived!.count} {donationsReceived!.count === 1 ? "donation" : "donations"} @@ -1483,7 +1500,7 @@ function PortfolioTab({ address, isOwnProfile }: { address: string; isOwnProfile {donationTotalCount} {donationTotalCount === 1 ? "donation" : "donations"} {totalDonated > BigInt(0) && ( - <> · {formatPrice(formatUnits(totalDonated, 18))} {RESERVE_LABEL} total loaded + <> · {formatPrice(formatUnits(totalDonated, 18))} {RESERVE_LABEL}{plotUsd != null && ` (≈ ${formatUsdValue(Number(formatUnits(totalDonated, 18)) * plotUsd)})`} total loaded )} )} @@ -1511,6 +1528,9 @@ function PortfolioTab({ address, isOwnProfile }: { address: string; isOwnProfile {formatPrice(formatUnits(BigInt(d.amount), 18))} {RESERVE_LABEL} + {plotUsd != null && ( + (≈ {formatUsdValue(Number(formatUnits(BigInt(d.amount), 18)) * plotUsd)}) + )} {d.tx_hash && (
{visible.map((entry, i) => ( - + ))}
{hasMore && ( @@ -1888,7 +1913,7 @@ const EVENT_COLORS: Record = { claimed_royalties: "text-green-700", }; -function FeedRow({ entry }: { entry: FeedEntry }) { +function FeedRow({ entry, plotUsd }: { entry: FeedEntry; plotUsd?: number | null }) { return (
{/* Row 1 (mobile) / Left (desktop): event type + story title */} @@ -1910,7 +1935,10 @@ function FeedRow({ entry }: { entry: FeedEntry }) { {/* Row 2 (mobile) / Right (desktop): detail + date + tx link */}
{entry.detail && ( - {entry.detail} + + {entry.detail} + {entry.reserveAmount != null && plotUsd != null && ` (≈ ${formatUsdValue(entry.reserveAmount * plotUsd)})`} + )}
@@ -148,14 +148,14 @@ export function ClaimRoyalties({ tokenAddress, plotCount, beneficiary, plotUsd } BigInt(0) ? "text-accent" : "text-foreground"}`}> {formatTruncated(unclaimed, decimals)} {RESERVE_LABEL} - {unclaimed > BigInt(0) && plotUsd && ( + {plotUsd != null && ( (≈ {formatUsdValue(parseFloat(formatUnits(unclaimed, decimals)) * plotUsd)}) )} {totalClaimed > BigInt(0) && ( - (claimed: {formatTruncated(totalClaimed, decimals)} {RESERVE_LABEL} so far) + (claimed: {formatTruncated(totalClaimed, decimals)} {RESERVE_LABEL}{plotUsd != null ? ` ≈ ${formatUsdValue(parseFloat(formatUnits(totalClaimed, decimals)) * plotUsd)}` : ""} so far) )}