Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/app/profile/[address]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import { getFullUserProfile, getFarcasterProfile } from "../../../../lib/actions";
import { truncateAddress } from "../../../../lib/utils";
import { formatPrice, formatSupply } from "../../../../lib/format";
import { getTokenPrice, mcv2BondAbi, erc20Abi, type TokenPriceInfo, get24hPriceChange, getTokenTVL } from "../../../../lib/price";

Check warning on line 14 in src/app/profile/[address]/page.tsx

View workflow job for this annotation

GitHub Actions / lint-and-typecheck

'TokenPriceInfo' is defined but never used
import { browserClient } from "../../../../lib/rpc";
import type { FarcasterProfile } from "../../../../lib/farcaster";
import type { AgentMetadata } from "../../../../lib/contracts/erc8004";
Expand All @@ -19,7 +19,7 @@
import { formatUsdValue } from "../../../../lib/usd-price";
import { DisconnectButton } from "../../../components/ConnectWallet";
import { GENRES, LANGUAGES } from "../../../../lib/genres";
import { DeadlineCountdown, DEADLINE_MS } from "../../../components/DeadlineCountdown";

Check warning on line 22 in src/app/profile/[address]/page.tsx

View workflow job for this annotation

GitHub Actions / lint-and-typecheck

'DeadlineCountdown' is defined but never used
import { ClaimRoyalties } from "../../../components/ClaimRoyalties";
import { WriterTradingStats } from "../../../components/WriterTradingStats";
import { DropdownSelect } from "../../../components/DropdownSelect";
Expand Down Expand Up @@ -656,9 +656,9 @@
const totalReaders = storylines?.reduce((sum, s) => sum + (s.view_count ?? 0), 0) ?? 0;
const donationsTotal = donationsData?.reduce((sum, d) => sum + BigInt(d.amount), BigInt(0)) ?? BigInt(0);
const combinedEarnings = (totalRoyalties ?? BigInt(0)) + donationsTotal;
const earningsStr = combinedEarnings > BigInt(0)
? `${formatPrice(formatUnits(combinedEarnings, 18))} ${RESERVE_LABEL}`
: "—";
const earningsPlot = Number(formatUnits(combinedEarnings, 18));
const earningsUsd = plotUsdPrice ? earningsPlot * plotUsdPrice : null;
const earningsPlotStr = earningsPlot > 0 ? `${formatPrice(formatUnits(combinedEarnings, 18))} ${RESERVE_LABEL}` : null;
const balanceStr = plotBalance != null
? formatCompact(Number(formatUnits(plotBalance, 18)))
: "—";
Expand All @@ -674,7 +674,12 @@
<div className="text-muted text-[9px]">Total Readers</div>
</div>
<div className="bg-surface-raised rounded-[var(--card-radius)] border border-border px-3 py-2 text-center">
<div className="text-foreground text-sm font-bold truncate">{earningsStr}</div>
<div className="text-foreground text-sm font-bold truncate">
{earningsPlot === 0 ? "$0" : earningsUsd !== null ? formatUsdValue(earningsUsd) : earningsPlotStr}
</div>
{earningsPlot > 0 && earningsUsd !== null && (
<div className="text-muted text-[10px] truncate">{earningsPlotStr}</div>
)}
<div className="text-muted text-[9px]">Creator Earnings</div>
</div>
<div className="bg-surface-raised rounded-[var(--card-radius)] border border-border px-3 py-2 text-center">
Expand Down Expand Up @@ -831,7 +836,7 @@
});

// Claimable royalties (own profile only)
const { data: royaltyInfo } = useQuery({

Check warning on line 839 in src/app/profile/[address]/page.tsx

View workflow job for this annotation

GitHub Actions / lint-and-typecheck

'royaltyInfo' is assigned a value but never used
queryKey: ["profile-royalties", address],
queryFn: async () => {
const [balance, claimed] = await browserClient.readContract({
Expand Down
Loading