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
28 changes: 17 additions & 11 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 } 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 Down Expand Up @@ -133,7 +133,7 @@
if (r <= 0) clearInterval(interval);
}, 1000);
return () => clearInterval(interval);
}, [dbUser?.steemhunt_fetched_at]);

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

View workflow job for this annotation

GitHub Actions / lint-and-typecheck

React Hook useEffect has a missing dependency: 'COOLDOWN_MS'. Either include it or remove the dependency array

const onCooldown = cooldownRemaining > 0;

Expand Down Expand Up @@ -667,7 +667,7 @@
});

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

Check warning on line 670 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 Expand Up @@ -736,21 +736,27 @@
</div>
<div className="border-border rounded border px-3 py-1.5">
<span className="text-muted">Donations Received:</span>{" "}
<span className="text-foreground font-medium">
{totalDonations > BigInt(0) ? `${formatPrice(formatUnits(totalDonations, 18))} ${RESERVE_LABEL}` : "—"}
</span>
{totalDonations > BigInt(0) && plotUsd != null && (
<span className="text-muted"> ({formatUsdValue(Number(formatUnits(totalDonations, 18)) * plotUsd)})</span>
{totalDonations > BigInt(0) ? (
<>
<span className="text-foreground font-medium">
{plotUsd != null ? formatUsdValue(Number(formatUnits(totalDonations, 18)) * plotUsd) : `${formatPrice(formatUnits(totalDonations, 18))} ${RESERVE_LABEL}`}
</span>
{plotUsd != null && (
<span className="text-muted"> ({formatPrice(formatUnits(totalDonations, 18))} {RESERVE_LABEL})</span>
)}
</>
) : (
<span className="text-foreground font-medium">—</span>
)}
</div>
{claimedRoyalties !== undefined && claimedRoyalties > BigInt(0) && (
<div className="border-border rounded border px-3 py-1.5">
<span className="text-muted">Royalties Claimed:</span>{" "}
<span className="text-foreground font-medium">
{formatPrice(formatUnits(claimedRoyalties, 18))} {RESERVE_LABEL}
{plotUsd != null ? formatUsdValue(Number(formatUnits(claimedRoyalties, 18)) * plotUsd) : `${formatPrice(formatUnits(claimedRoyalties, 18))} ${RESERVE_LABEL}`}
</span>
{plotUsd != null && (
<span className="text-muted"> ({formatUsdValue(Number(formatUnits(claimedRoyalties, 18)) * plotUsd)})</span>
<span className="text-muted"> ({formatPrice(formatUnits(claimedRoyalties, 18))} {RESERVE_LABEL})</span>
)}
</div>
)}
Expand Down Expand Up @@ -818,7 +824,7 @@
}) {
const tokenAddr = storyline.token_address as Address;

const { data: priceInfo } = useQuery({

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

View workflow job for this annotation

GitHub Actions / lint-and-typecheck

'priceInfo' is assigned a value but never used
queryKey: ["profile-story-price", storyline.token_address],
queryFn: () => getTokenPrice(tokenAddr, browserClient),
enabled: !!storyline.token_address,
Expand Down Expand Up @@ -1088,7 +1094,7 @@

const DONATION_PAGE_SIZE = 10;

function ProfileDonationHistory({ storylineId }: { storylineId: number }) {

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

View workflow job for this annotation

GitHub Actions / lint-and-typecheck

'ProfileDonationHistory' is defined but never used
const { data: plotUsd } = usePlotUsdPrice();
const {
data,
Expand Down Expand Up @@ -1370,7 +1376,7 @@
const {
data: donationPages,
isLoading: donGivenLoading,
isFetchingNextPage: donFetchingNext,

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

View workflow job for this annotation

GitHub Actions / lint-and-typecheck

'donFetchingNext' is assigned a value but never used
fetchNextPage: donFetchNext,
hasNextPage: donHasNext,
} = useInfiniteQuery({
Expand Down Expand Up @@ -1877,16 +1883,16 @@
<div className="text-muted text-[9px]">Trades</div>
</div>
<div className="border-border rounded border px-2 py-1.5 text-center">
<div className="text-foreground text-sm font-bold">{totalTradeAmount > 0 ? formatPrice(totalTradeAmount) : "—"}</div>
<div className="text-muted text-[9px]">Trade Vol ({RESERVE_LABEL})</div>
<div className="text-foreground text-sm font-bold">{totalTradeAmount > 0 && plotUsd != null ? formatUsdValue(totalTradeAmount * plotUsd) : "—"}</div>
<div className="text-muted text-[9px]">Trade Vol</div>
</div>
<div className="border-border rounded border px-2 py-1.5 text-center">
<div className="text-foreground text-sm font-bold">{donationEntries.length}</div>
<div className="text-muted text-[9px]">Donations</div>
</div>
<div className="border-border rounded border px-2 py-1.5 text-center">
<div className="text-foreground text-sm font-bold">{totalDonationAmount > 0 ? formatPrice(totalDonationAmount) : "—"}</div>
<div className="text-muted text-[9px]">Donated ({RESERVE_LABEL})</div>
<div className="text-foreground text-sm font-bold">{totalDonationAmount > 0 && plotUsd != null ? formatUsdValue(totalDonationAmount * plotUsd) : "—"}</div>
<div className="text-muted text-[9px]">Donated</div>
</div>
</div>
</div>
Expand Down
Loading