Files
famapp/src/components/bottom-nav.tsx
T
ginnoir 65d36bab4e
Release / build-and-push (push) Has been cancelled
fix: drive bottom nav from module registry so all modules appear on mobile
The bottom nav was hardcoded; the sidebar already read from the module
registry. Converted BottomNav to a server component that calls
getRegistry() using the same pattern as Sidebar, so any module with a
nav field automatically populates both nav surfaces.

Bumps version to 0.4.2.
2026-06-02 01:55:36 -05:00

22 lines
709 B
TypeScript

import { getRegistry } from "@/modules/_core/registry";
import { NavLink } from "@/components/nav-link";
export async function BottomNav() {
const { modules } = getRegistry();
const moduleNav = modules.flatMap((m) => (m.nav ? [m.nav] : []));
const items = [
{ href: "/", label: "Dashboard", icon: "home" },
...moduleNav.map((n) => ({ href: n.href, label: n.label, icon: n.icon ?? "circle" })),
{ href: "/settings", label: "Settings", icon: "settings" },
];
return (
<nav className="bottom-nav" aria-label="Primary navigation">
{items.map((it) => (
<NavLink key={it.href} href={it.href} icon={it.icon} label={it.label} variant="bottom" />
))}
</nav>
);
}