From 65d36bab4e53f7c3954afea571c27caf3dc74911 Mon Sep 17 00:00:00 2001 From: ginnoir Date: Tue, 2 Jun 2026 01:55:36 -0500 Subject: [PATCH] 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. --- package.json | 2 +- src/components/bottom-nav.tsx | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index a4d03dc..112bd60 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "famapp", - "version": "0.4.0", + "version": "0.4.2", "private": true, "type": "module", "packageManager": "pnpm@10.33.3", diff --git a/src/components/bottom-nav.tsx b/src/components/bottom-nav.tsx index 840dcb1..a4804e3 100644 --- a/src/components/bottom-nav.tsx +++ b/src/components/bottom-nav.tsx @@ -1,19 +1,19 @@ -"use client"; - +import { getRegistry } from "@/modules/_core/registry"; import { NavLink } from "@/components/nav-link"; -const ITEMS: Array<{ href: string; label: string; icon: string }> = [ - { href: "/", label: "Dashboard", icon: "home" }, - { href: "/calendar", label: "Calendar", icon: "calendar" }, - { href: "/lists", label: "Lists", icon: "list" }, - { href: "/notes", label: "Notes", icon: "note" }, - { href: "/settings", label: "Settings", icon: "settings" }, -]; +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" }, + ]; -export function BottomNav() { return (