feat: add mobile sidebar

This commit is contained in:
gosangam
2026-04-17 23:20:59 +05:30
parent 0aab1d23ec
commit 9b5823146f
30 changed files with 2502 additions and 414 deletions
+16
View File
@@ -3,6 +3,7 @@ import { PageHeader } from "@/components/page-header";
import { notFound } from "next/navigation";
import { getBookMeta, getSingleVerse, getChapterVerseIndex } from "@/lib/api";
import { ChapterViewer } from "@/app/books/chapter-viewer";
import type { MobileNavGroup } from "@/components/mobile-nav";
type BgMeta = {
book: string;
@@ -42,6 +43,19 @@ export default async function VersePage({
);
if (!verse) notFound();
// Build mobile nav groups — single flat list of chapters
const mobileNavGroups: MobileNavGroup[] = [
{
title: "Chapters",
items: bgMeta.chapters.map((ch) => ({
slug: `${ch.number}`,
label: `${ch.number}. ${ch.title}`,
href: `/books/bg/${ch.number}/1`,
type: "chapter",
})),
},
];
return (
<div className="min-h-screen bg-background">
<PageHeader sticky wide>
@@ -70,6 +84,8 @@ export default async function VersePage({
chapter={parseInt(chapter)}
basePath={`/books/bg/${chapter}`}
showBengali={false}
mobileNavGroups={mobileNavGroups}
mobileNavBookTitle="Bhagavad-gītā As It Is"
/>
</div>
</div>