Skip to content

Commit 387b276

Browse files
committed
Add mobile theme toggle and SVG stat icons
Introduce a mobile theme toggle UI and convert stat icons to inline SVGs. Changes: add .nav-mobile-theme-toggle CSS; update Stat type to accept JSX.Element and optional iconBg; replace emoji icons with SVG/span elements; use s.iconBg (with fallback) for icon background in TrustBar; make community grid responsive via auto-fit minmax; integrate useColorMode and ColorModeToggle into MobileMenu to surface the theme control. These tweaks improve visual consistency and mobile usability.
1 parent cc267dd commit 387b276

3 files changed

Lines changed: 58 additions & 8 deletions

File tree

src/css/custom.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,12 @@ a {
754754
border-top-color: #1e293b;
755755
}
756756

757+
.nav-mobile-theme-toggle {
758+
display: flex;
759+
align-items: center;
760+
gap: 0.75rem;
761+
}
762+
757763
.nav-mobile-cta {
758764
display: flex;
759765
align-items: center;

src/pages/index.tsx

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ interface Product {
2020
interface Stat {
2121
value: string;
2222
label: string;
23-
icon: string;
23+
icon: JSX.Element;
24+
iconBg?: string;
2425
}
2526

2627
interface CommunityLink {
@@ -65,10 +66,47 @@ const products: Product[] = [
6566
];
6667

6768
const stats: Stat[] = [
68-
{ value: "3", label: "Products", icon: "\u{1F4E6}" },
69-
{ value: "100%", label: "Open Source", icon: "\u{1F513}" },
70-
{ value: "Apache 2.0", label: "License", icon: "\u{1F4DC}" },
71-
{ value: "Java + React", label: "Stack", icon: "\u26A1" },
69+
{
70+
value: "3",
71+
label: "Products",
72+
icon: (
73+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="text-brand">
74+
<path d="M12 3l8 4.5v9l-8 4.5-8-4.5v-9l8-4.5z" />
75+
<path d="M12 12l8-4.5" />
76+
<path d="M12 12v9" />
77+
<path d="M12 12L4 7.5" />
78+
<path d="M16 5.25l-8 4.5" />
79+
</svg>
80+
),
81+
},
82+
{
83+
value: "100%",
84+
label: "Open Source",
85+
icon: (
86+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="text-brand">
87+
<path d="M7 8l-4 4 4 4" />
88+
<path d="M17 8l4 4-4 4" />
89+
<path d="M14 4l-4 16" />
90+
</svg>
91+
),
92+
},
93+
{
94+
value: "Apache 2.0",
95+
label: "License",
96+
iconBg: "bg-emerald-50",
97+
icon: (
98+
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" className="text-emerald-600">
99+
<path d="M12 0C5.37 0 0 5.37 0 12c0 5.3 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61-.546-1.385-1.335-1.755-1.335-1.755-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23A11.52 11.52 0 0112 5.803c1.02.005 2.047.138 3.006.404 2.29-1.552 3.297-1.23 3.297-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 21.795 24 17.295 24 12c0-6.63-5.37-12-12-12z" />
100+
</svg>
101+
),
102+
},
103+
{
104+
value: "Java + React",
105+
label: "Stack",
106+
icon: (
107+
<span className="text-brand font-extrabold text-sm">Java</span>
108+
),
109+
},
72110
];
73111

74112
const community: CommunityLink[] = [
@@ -310,7 +348,7 @@ function TrustBar(): JSX.Element {
310348
className="flex items-center gap-3 py-5 px-8"
311349
style={{ borderRight: i < stats.length - 1 ? "1px solid var(--color-border)" : "none" }}
312350
>
313-
<div className="w-10 h-10 rounded-xl bg-brand-bg flex items-center justify-center text-lg">
351+
<div className={`w-10 h-10 rounded-xl flex items-center justify-center ${s.iconBg || "bg-brand-bg"}`}>
314352
{s.icon}
315353
</div>
316354
<div>
@@ -400,7 +438,7 @@ function CommunitySection(): JSX.Element {
400438

401439
<div
402440
className="grid gap-6"
403-
style={{ gridTemplateColumns: "repeat(3, 1fr)" }}
441+
style={{ gridTemplateColumns: "repeat(auto-fit, minmax(280px, 1fr))" }}
404442
>
405443
{community.map((c) => (
406444
<a

src/theme/Navbar/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ function ProductNavItem({ product, isActive }: { product: Product; isActive: boo
147147
/* ── Mobile Dropdown Menu (below header, not overlay) ── */
148148
function MobileMenu({ isOpen, onClose }: { isOpen: boolean; onClose: () => void }): JSX.Element | null {
149149
const activeProduct = useActiveProduct();
150+
const { colorMode, setColorMode } = useColorMode();
150151
if (!isOpen) return null;
151152

152153
return (
@@ -172,7 +173,12 @@ function MobileMenu({ isOpen, onClose }: { isOpen: boolean; onClose: () => void
172173
);
173174
})}
174175
<hr className="nav-mobile-hr" />
175-
<a
176+
<div className="nav-mobile-item nav-mobile-theme-toggle">
177+
<ColorModeToggle value={colorMode} onChange={setColorMode} />
178+
<span className="text-muted-foreground text-sm">Tema</span>
179+
</div>
180+
<hr className="nav-mobile-hr" />
181+
<
176182
href="https://viglet.org"
177183
target="_blank"
178184
rel="noopener noreferrer"

0 commit comments

Comments
 (0)