fix: bg chapter verse index

This commit is contained in:
gosangam
2026-04-18 01:39:01 +05:30
parent c573c94c51
commit 5235f479b3
30 changed files with 113 additions and 115 deletions
+10 -8
View File
@@ -43,15 +43,17 @@ export default async function VersePage({
);
if (!verse) notFound();
// Build mobile nav groups — single flat list of chapters
// Build mobile nav groups — verses for the current chapter
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",
title: "Verses",
items: verseIndex.map((v) => ({
slug: String(v.verse),
label: v.verseEnd
? `Verse ${chapter}.${v.verse}–${v.verseEnd}`
: `Verse ${chapter}.${v.verse}`,
href: `/books/bg/${chapter}/${v.verse}`,
type: "verse",
})),
},
];
@@ -85,7 +87,7 @@ export default async function VersePage({
basePath={`/books/bg/${chapter}`}
showBengali={false}
mobileNavGroups={mobileNavGroups}
mobileNavBookTitle="Bhagavad-gītā As It Is"
mobileNavBookTitle={`Chapter ${chapter}: ${title}`}
/>
</div>
</div>
+2 -2
View File
@@ -45,7 +45,7 @@ export default async function BgPage() {
<li key={ch.number}>
<Link
href={`/books/bg/${ch.number}`}
className="flex items-center justify-between px-5 py-4 hover:bg-muted transition-colors"
className="flex flex-col sm:flex-row sm:items-center sm:justify-between px-5 py-4 gap-1 sm:gap-0 hover:bg-muted transition-colors"
>
<div>
<span className="text-sm text-primary font-medium">
@@ -53,7 +53,7 @@ export default async function BgPage() {
</span>
<p className="font-medium text-foreground">{ch.title}</p>
</div>
<span className="text-sm text-muted-foreground shrink-0 ml-4">
<span className="text-sm text-muted-foreground sm:shrink-0 sm:ml-4">
<ExtractedVerseCount count={ch.totalVerses} />
</span>
</Link>