Skip to content
Merged
Show file tree
Hide file tree
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
36 changes: 15 additions & 21 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 @@ -631,7 +631,7 @@
});

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

Check warning on line 634 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 @@ -756,7 +756,7 @@
}) {
const tokenAddr = storyline.token_address as Address;

const { data: priceInfo } = useQuery({

Check warning on line 759 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 @@ -804,12 +804,11 @@
<>
<div className="border-border rounded border divide-y divide-border text-xs">
{/* Moleskine book (left) + Info (right) */}
<div className="flex flex-col sm:flex-row gap-4 px-4 py-3">
<div className="flex flex-row gap-4 px-4 py-3">
{/* Moleskine book card */}
<Link
href={`/story/${storyline.storyline_id}`}
className="moleskine-notebook group relative block shrink-0 self-start"
style={{ width: "120px" }}
className="moleskine-notebook group relative block shrink-0 self-start w-[110px] sm:w-[150px]"
>
<div
className="notebook-cover relative z-10 flex flex-col overflow-hidden border border-[var(--border)]"
Expand Down Expand Up @@ -844,12 +843,6 @@

{/* Info (right) */}
<div className="min-w-0 flex-1 space-y-1">
<Link
href={`/story/${storyline.storyline_id}`}
className="font-body text-base font-bold text-accent hover:opacity-80 transition-opacity"
>
{storyline.title}
</Link>
<div className="space-y-0.5">
<div>
<span className="text-muted">Plots:</span> <span className="text-foreground font-medium">{storyline.plot_count}</span>
Expand All @@ -864,17 +857,19 @@
<div><span className="text-muted">Views:</span> <span className="text-foreground font-medium">{formatViewCount(storyline.view_count)}</span></div>
<div><span className="text-muted">Created:</span> <span className="text-foreground font-medium">{storyline.block_timestamp ? new Date(storyline.block_timestamp).toLocaleDateString("en-US", { month: "short", day: "numeric" }) : "—"}</span></div>
</div>
{/* TVL + Donations (inline in info area) */}
{storyline.token_address && (
<>
<div className="border-t border-border w-12 my-1.5" />
<div className="space-y-0.5">
<WriterTradingStats storyline={storyline} plotUsd={plotUsd} showPrice={false} />
<StoryDonationCount storylineId={storyline.storyline_id} tokenAddress={storyline.token_address} />
</div>
</>
)}
</div>
</div>

{/* TVL + Donations (below book row, no Price) */}
{storyline.token_address && (
<div className="px-4 py-2 space-y-1">
<WriterTradingStats storyline={storyline} plotUsd={plotUsd} showPrice={false} />
<StoryDonationCount storylineId={storyline.storyline_id} tokenAddress={storyline.token_address} />
</div>
)}

{/* Deadline */}
{!storyline.sunset && storyline.last_plot_time && (
<div className="px-4 py-2">
Expand Down Expand Up @@ -1014,7 +1009,7 @@

const DONATION_PAGE_SIZE = 10;

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

Check warning on line 1012 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 @@ -1387,15 +1382,14 @@
{/* Token holdings */}
{hasHoldings && (
<>
<p className="text-muted text-[10px] uppercase tracking-wider">Token Holdings</p>
<p className="text-muted text-[10px] uppercase tracking-wider">Story Token Holdings</p>
{holdings!.map((h) => (
<div key={h.storyline.id} className="border-border rounded border text-xs">
{/* Moleskine book (left) + Info (right) */}
<div className="flex flex-col sm:flex-row gap-4 px-4 py-3">
<div className="flex flex-row gap-4 px-4 py-3">
<Link
href={`/story/${h.storyline.storyline_id}`}
className="moleskine-notebook group relative block shrink-0 self-start"
style={{ width: "120px" }}
className="moleskine-notebook group relative block shrink-0 self-start w-[110px] sm:w-[150px]"
>
<div
className="notebook-cover relative z-10 flex flex-col overflow-hidden border border-[var(--border)]"
Expand Down
7 changes: 2 additions & 5 deletions src/components/ClaimRoyalties.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,15 @@ export function ClaimRoyalties({ tokenAddress, plotCount, beneficiary, plotUsd }
return (
<div className="text-xs space-y-1">
<p className="text-muted text-[10px] uppercase tracking-wider">Royalties</p>
{/* Claimable row */}
<div>
{/* Claimable row + Claim button inline */}
<div className="flex items-center gap-2">
<span className="text-muted">Claimable:</span>{" "}
<span className={`font-medium ${unclaimed > BigInt(0) ? "text-accent" : "text-foreground"}`}>
{formatTruncated(unclaimed, decimals)} {RESERVE_LABEL}
</span>
{plotUsd != null && unclaimed > BigInt(0) && (
<span className="text-muted"> ({formatUsdValue(parseFloat(formatUnits(unclaimed, decimals)) * plotUsd)})</span>
)}
</div>
{/* Claim button */}
<div className="flex items-center gap-2 justify-end">
<button
onClick={txState === "error" ? reset : executeClaim}
disabled={
Expand Down
Loading