Skip to content

Commit 740ffcd

Browse files
sktbrdclaude
andauthored
fix(newhome): make the auction panel follow the theme (#255)
The homepage's theme pass converted the newhome components from literal near-blacks to semantic tokens, but it missed the auction card's own ground: it still painted `bg-[linear-gradient(180deg,#181410,#0f0d0b)]` under a 50px black drop shadow. On a light page every panel around it inverted and the auction stayed a dark slab. Adopts the surface of the proposals/feed panel it sits beside in GovSection (`rounded-2xl border-border bg-card p-5`, no shadow), keeping the gold border as the accent that tells the two apart. Measured after: both panels resolve to the same background in both themes. Four more leftovers in the same file, all the same class of bug: - countdown digits were `bg-black`; now `bg-foreground/10`, which is what the `--` fallback three lines below already used - the idle status dot and the non-leading rank number were a literal `#737373`; now `var(--muted-foreground)` - the leaderboard panel was `border-white/[0.07] bg-black/25` — an invisible border over a grey slab on white; now `border-border bg-muted/40` - the crown chip read `text-foreground` while sitting on a deliberately dark overlay, so it painted near-black text on a near-black chip the moment the page went light; now `text-white`, like the #id chip beside it The bid figure keeps its gold ramp but darkens it in light mode. Clipped into text, #f7c948 lands near 1.6:1 on a white card — the trap stake-ui already documents — which would have left the card's most important number as its least readable. Same ramp shape, amber stops, as classes so each theme carries its own. Deliberately unchanged: the two chips over the Gnar artwork stay dark in both themes, and the live badge keeps its literal gold fill with dark ink. Both read on either ground, which is the rule the theme pass set. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 2a1f850 commit 740ffcd

1 file changed

Lines changed: 32 additions & 12 deletions

File tree

src/components/newhome/AuctionPanel.tsx

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { useAuctionLive } from "@/hooks/use-auction-live";
1313
import { useBidComments } from "@/hooks/use-bid-comments";
1414
import { useUserAddress } from "@/hooks/use-user-address";
1515
import { CHAIN, DAO_ADDRESSES } from "@/lib/config";
16+
import { cn } from "@/lib/utils";
1617
import auctionAbi from "@/utils/abis/auctionAbi";
1718
import { avatarGradient, GOLD, truncateAddress } from "./gov-ui";
1819

@@ -119,7 +120,12 @@ export function AuctionPanel() {
119120
const noop = useCallback(() => {}, []);
120121

121122
return (
122-
<div className="flex h-full flex-col gap-4 rounded-2xl border border-[#f7c948]/25 bg-[linear-gradient(180deg,#181410,#0f0d0b)] p-5 shadow-[0_0_0_1px_rgba(0,0,0,.4),0_20px_50px_rgba(0,0,0,.35)]">
123+
// Same surface as the proposals/feed panel it sits beside in GovSection
124+
// (`rounded-2xl border-border bg-card p-5`), keeping only the gold border as
125+
// the accent that tells the two apart. It used to paint a literal near-black
126+
// gradient with a 50px black drop shadow, so on a light page the auction
127+
// stayed a dark slab while everything around it inverted.
128+
<div className="flex h-full flex-col gap-4 rounded-2xl border border-[#f7c948]/25 bg-card p-5">
123129
{/* Badge + countdown */}
124130
<div className="flex items-center justify-between gap-3">
125131
{/* The badge tracks the clock. Between an auction ending and someone
@@ -142,7 +148,7 @@ export function AuctionPanel() {
142148
style={
143149
isLive
144150
? { background: "#1a1205", animation: "gnars-pulse 1.8s infinite" }
145-
: { background: "#737373" }
151+
: { background: "var(--muted-foreground)" }
146152
}
147153
/>
148154
{isLive ? t("liveAuction") : t("awaitingSettlement")}
@@ -152,7 +158,7 @@ export function AuctionPanel() {
152158
[countdown.hours, countdown.minutes, countdown.seconds].map((part, i) => (
153159
<span key={i} className="flex items-center gap-[3px]">
154160
{i > 0 && <span className="text-muted-foreground/70">:</span>}
155-
<span className="rounded-[5px] bg-black px-[7px] py-[3px] tabular-nums">
161+
<span className="rounded-[5px] bg-foreground/10 px-[7px] py-[3px] tabular-nums">
156162
{part}
157163
</span>
158164
</span>
@@ -174,9 +180,15 @@ export function AuctionPanel() {
174180
</span>
175181
)}
176182
{/* An auction that closed without a bid reports the zero address as its
177-
"winner" — crowning that reads as a real leader, so it is dropped. */}
183+
"winner" — crowning that reads as a real leader, so it is dropped.
184+
185+
`text-white`, not `text-foreground`: both chips here sit ON the Gnar
186+
artwork, so they stay dark in either theme — and a foreground that
187+
inverts would have painted near-black text onto a near-black chip the
188+
moment the page went light. The #id chip above was already safe (gold
189+
on dark); this one was not. */}
178190
{displayBidder && !ZERO_BIDDER.test(displayBidder) && (
179-
<span className="absolute right-2.5 top-2.5 flex items-center gap-1.5 rounded-lg bg-[#0a0908]/70 px-2.5 py-1 text-[11px] font-bold text-foreground backdrop-blur-sm">
191+
<span className="absolute right-2.5 top-2.5 flex items-center gap-1.5 rounded-lg bg-[#0a0908]/70 px-2.5 py-1 text-[11px] font-bold text-white backdrop-blur-sm">
180192
👑 {truncateAddress(displayBidder)}
181193
</span>
182194
)}
@@ -188,10 +200,13 @@ export function AuctionPanel() {
188200
<span className="shrink-0 text-[11px] font-semibold uppercase tracking-[0.14em] text-muted-foreground">
189201
{t("currentBid")}
190202
</span>
191-
<span
192-
className="bg-clip-text font-mono text-3xl font-extrabold leading-none tabular-nums text-transparent"
193-
style={{ backgroundImage: GOLD }}
194-
>
203+
{/* The ramp stays, but it darkens in light mode. The dark-mode ramp
204+
runs #f7c948 → #f5851f; clipped into text on a white card its light
205+
end lands near 1.6:1, so the card's single most important number
206+
would be the least readable thing on it. Same ramp shape, amber
207+
stops, set as classes rather than the inline GOLD so each theme can
208+
carry its own. */}
209+
<span className="bg-[linear-gradient(90deg,#b45309,#c2410c)] bg-clip-text font-mono text-3xl font-extrabold leading-none tabular-nums text-transparent dark:bg-[linear-gradient(90deg,#f7c948,#f5851f)]">
195210
{displayBid ? Number(displayBid).toFixed(3) : "0.000"} ETH
196211
</span>
197212
</div>
@@ -210,15 +225,20 @@ export function AuctionPanel() {
210225

211226
{/* Leaderboard */}
212227
{bids.length > 0 && (
213-
<div className="flex flex-col gap-1.5 rounded-xl border border-white/[0.07] bg-black/25 p-3">
228+
<div className="flex flex-col gap-1.5 rounded-xl border border-border bg-muted/40 p-3">
214229
<span className="text-[10.5px] font-bold uppercase tracking-[0.14em] text-muted-foreground">
215230
{t("leaderboard", { count: bids.length })}
216231
</span>
217232
{bids.slice(0, 4).map((bid, i) => (
218233
<div key={bid.id} className="flex items-center gap-2.5 py-[5px]">
234+
{/* Gold only carries the leader in dark. #f7c948 on a white card is
235+
~1.6:1 — the same trap stake-ui documents — so light mode steps
236+
down to amber. */}
219237
<span
220-
className="w-4 font-mono text-[11.5px] font-bold"
221-
style={{ color: i === 0 ? "#f7c948" : "#737373" }}
238+
className={cn(
239+
"w-4 font-mono text-[11.5px] font-bold",
240+
i === 0 ? "text-amber-700 dark:text-[#f7c948]" : "text-muted-foreground",
241+
)}
222242
>
223243
{i + 1}
224244
</span>

0 commit comments

Comments
 (0)