Skip to content

Commit 27cc0d2

Browse files
authored
Merge pull request #3382 from ava-labs/playground-menu-changes
playground menu changes for convenience
2 parents dc22bc0 + 958f75d commit 27cc0d2

File tree

5 files changed

+44
-7
lines changed

5 files changed

+44
-7
lines changed

app/(home)/stats/playground/my-dashboards/page.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { useLoginModalTrigger } from "@/hooks/useLoginModal";
88
import { LoginModal } from "@/components/login/LoginModal";
99
import { Card } from "@/components/ui/card";
1010
import { toast } from "@/lib/toast";
11+
import { StatsBubbleNav } from "@/components/stats/stats-bubble.config";
1112

1213
export default function MyDashboardsPage() {
1314
const { data: session, status } = useSession();
@@ -357,6 +358,9 @@ export default function MyDashboardsPage() {
357358
</div>
358359
</Card>
359360
)}
361+
362+
{/* Bubble Navigation */}
363+
<StatsBubbleNav />
360364
</div>
361365
</div>
362366
);

app/(home)/stats/playground/page.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { cn } from "@/lib/utils";
1313
import { useLoginModalTrigger } from "@/hooks/useLoginModal";
1414
import { LoginModal } from "@/components/login/LoginModal";
1515
import { toast } from "@/lib/toast";
16+
import { StatsBubbleNav } from "@/components/stats/stats-bubble.config";
1617

1718
interface ChartConfig {
1819
id: string;
@@ -1361,6 +1362,9 @@ function PlaygroundContent() {
13611362
</div>
13621363
)}
13631364
</div>
1365+
1366+
{/* Bubble Navigation */}
1367+
<StatsBubbleNav />
13641368
</div>
13651369
);
13661370
}

app/layout.config.tsx

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,33 +111,59 @@ export const stats: LinkItemType = {
111111
text: "Stats",
112112
url: "/stats/overview",
113113
items: [
114+
{
115+
menu: {
116+
banner: (
117+
<div className='-mx-3 -mt-3'>
118+
<Image
119+
src="/builderhub-playground.png"
120+
alt='Playground Preview'
121+
width={500}
122+
height={140}
123+
className='rounded-t-lg object-cover'
124+
style={{
125+
maskImage: 'linear-gradient(to bottom,white 60%,transparent)',
126+
}}
127+
/>
128+
</div>
129+
),
130+
className: 'md:row-span-2 lg:col-span-1',
131+
},
132+
icon: <DraftingCompass />,
133+
text: "Playground",
134+
url: "/stats/playground",
135+
description:
136+
"Create and customize multiple charts with real-time chain metrics.",
137+
},
114138
{
115139
icon: <Logs />,
116140
text: "Avalanche L1s",
117141
url: "/stats/overview",
118142
description:
119143
"View the latest metrics for all Avalanche L1s in the network.",
144+
menu: {
145+
className: 'lg:col-start-2 lg:row-start-1',
146+
},
120147
},
121148
{
122149
icon: <Network />,
123150
text: "C-Chain",
124151
url: "/stats/primary-network/c-chain",
125152
description:
126153
"View the latest metrics for the Avalanche C-Chain.",
154+
menu: {
155+
className: 'lg:col-start-2 lg:row-start-2',
156+
},
127157
},
128158
{
129159
icon: <Hexagon />,
130160
text: "Primary Network Validators",
131161
url: "/stats/validators",
132162
description:
133163
"View the latest metrics for the Avalanche Primary Network validators.",
134-
},
135-
{
136-
icon: <DraftingCompass />,
137-
text: "Playground",
138-
url: "/stats/playground",
139-
description:
140-
"Create and customize multiple charts with real-time chain metrics.",
164+
menu: {
165+
className: 'lg:col-start-3 lg:row-start-1',
166+
},
141167
},
142168
],
143169
};

components/stats/stats-bubble.config.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export const statsBubbleConfig: BubbleNavigationConfig = {
77
items: [
88
{ id: "avalanche-l1s", label: "Avalanche L1s", href: "/stats/overview" },
99
{ id: "c-chain", label: "C-Chain", href: "/stats/primary-network/c-chain" },
10+
{ id: "playground", label: "Playground", href: "/stats/playground" },
1011
{ id: "validators", label: "Validators", href: "/stats/validators" },
1112
],
1213
activeColor: "bg-blue-600",
@@ -23,6 +24,8 @@ export function StatsBubbleNav() {
2324
return currentItem.id;
2425
} else if (pathname.startsWith("/stats/l1/")) {
2526
return "";
27+
} else if (pathname.startsWith("/stats/playground")) {
28+
return "playground";
2629
}
2730
return "overview";
2831
};

public/builderhub-playground.png

780 KB
Loading

0 commit comments

Comments
 (0)