Skip to content

Commit 2344a56

Browse files
authored
Merge branch 'master' into fumadocs-openapi/customize
2 parents 017151b + 68cafed commit 2344a56

File tree

2 files changed

+65
-14
lines changed

2 files changed

+65
-14
lines changed

app/(home)/stats/l1/[[...slug]]/page.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export default async function L1Metrics({
6262
chainName={currentChain.chainName}
6363
description={`Real-time insights into ${currentChain.chainName} L1 activity and network usage`}
6464
themeColor={currentChain.color || "#E57373"}
65+
chainLogoURI={currentChain.chainLogoURI}
6566
/>
6667
);
6768
}

components/stats/ChainMetricsPage.tsx

Lines changed: 64 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,15 @@ interface ChainMetricsPageProps {
5757
chainName?: string;
5858
description?: string;
5959
themeColor?: string;
60+
chainLogoURI?: string;
6061
}
6162

6263
export default function ChainMetricsPage({
6364
chainId = "43114",
6465
chainName = "Avalanche C-Chain",
6566
description = "Real-time metrics and analytics for the Avalanche C-Chain",
6667
themeColor = "#E57373",
68+
chainLogoURI,
6769
}: ChainMetricsPageProps) {
6870
const [metrics, setMetrics] = useState<CChainMetrics | null>(null);
6971
const [loading, setLoading] = useState(true);
@@ -426,23 +428,71 @@ export default function ChainMetricsPage({
426428
<div className="min-h-screen bg-gradient-to-br from-background to-muted/20 pt-8">
427429
<div className="container mx-auto mt-4 p-4 sm:p-6 pb-24 space-y-8 sm:space-y-12">
428430
{/* Header */}
429-
<div className="space-y-3">
430-
<div className="flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3 sm:gap-4">
431-
<div className="min-w-0 flex-1">
432-
<h1 className="text-xl sm:text-2xl md:text-5xl break-words mb-2">
433-
{chainName.includes("C-Chain")
434-
? "Avalanche C-Chain Metrics"
435-
: `${chainName} L1 Metrics`}
436-
</h1>
437-
<p className="text-zinc-400 text-sm sm:text-md text-left">
438-
{description}
439-
</p>
440-
</div>
431+
<div className="relative overflow-hidden rounded-2xl p-8 sm:p-12">
432+
{/* Multi-layer gradient background */}
433+
<div className="absolute inset-0 bg-black" />
434+
<div
435+
className="absolute inset-0 opacity-60"
436+
style={{
437+
background: `linear-gradient(140deg, ${themeColor}88 0%, transparent 70%)`
438+
}}
439+
/>
440+
<div
441+
className="absolute inset-0 opacity-40"
442+
style={{
443+
background: `linear-gradient(to top left, ${themeColor}66 0%, transparent 50%)`
444+
}}
445+
/>
446+
<div
447+
className="absolute inset-0 opacity-30"
448+
style={{
449+
background: `radial-gradient(circle at 50% 50%, ${themeColor}44 0%, transparent 70%)`
450+
}}
451+
/>
452+
453+
{/* Content */}
454+
<div className="relative z-10">
455+
{/* Top row with ExplorerDropdown */}
441456
{!chainName.includes("C-Chain") && currentChain?.explorers && (
442-
<div className="shrink-0 mt-1">
443-
<ExplorerDropdown explorers={currentChain.explorers} />
457+
<div className="flex justify-end mb-4">
458+
<div className="[&_button]:border-neutral-300 dark:[&_button]:border-white/30 [&_button]:text-neutral-800 dark:[&_button]:text-white [&_button]:hover:bg-neutral-100 dark:[&_button]:hover:bg-white/10 [&_button]:hover:border-neutral-400 dark:[&_button]:hover:border-white/50">
459+
<ExplorerDropdown
460+
explorers={currentChain.explorers}
461+
variant="outline"
462+
size="sm"
463+
/>
464+
</div>
444465
</div>
445466
)}
467+
468+
{/* Main content row */}
469+
<div className="flex flex-col sm:flex-row items-start gap-6">
470+
{/* Logo */}
471+
{chainLogoURI && (
472+
<div className="shrink-0">
473+
<img
474+
src={chainLogoURI}
475+
alt={`${chainName} logo`}
476+
className="w-20 h-20 sm:w-24 sm:h-24 rounded-xl object-contain bg-white/10 p-2"
477+
onError={(e) => {
478+
(e.target as HTMLImageElement).style.display = 'none';
479+
}}
480+
/>
481+
</div>
482+
)}
483+
484+
{/* Title and description */}
485+
<div className="flex-1 min-w-0">
486+
<h1 className="text-2xl sm:text-3xl md:text-4xl font-semibold text-white mb-3 break-words">
487+
{chainName.includes("C-Chain")
488+
? "Avalanche C-Chain Metrics"
489+
: `${chainName} L1 Metrics`}
490+
</h1>
491+
<p className="text-white/80 text-sm sm:text-base max-w-3xl">
492+
{description}
493+
</p>
494+
</div>
495+
</div>
446496
</div>
447497
</div>
448498

0 commit comments

Comments
 (0)