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
@@ -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 Sb1962Meta = {
book: string;
@@ -46,6 +47,23 @@ export default async function VersePage({
);
if (!verse) notFound();
const mobileNavGroups: MobileNavGroup[] = [
{
title: "Verses",
items: verseIndex.map((v) => {
const label = v.verseEnd
? `Verses ${v.verse}–${v.verseEnd}`
: `Verse ${v.verse}`;
return {
slug: String(v.verse),
label,
href: `/books/sb1962/${chapter}/${v.verse}`,
type: "verse",
};
}),
},
];
return (
<div className="min-h-screen bg-background">
<PageHeader sticky wide>
@@ -74,6 +92,8 @@ export default async function VersePage({
chapter={parseInt(chapter)}
basePath={`/books/sb1962/${chapter}`}
showBengali={false}
mobileNavGroups={mobileNavGroups}
mobileNavBookTitle={`Śrīmad-Bhāgavatam (1962) — Ch. ${chapter}`}
/>
</div>
</div>