Compare commits
27
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1984797ad3 | ||
|
|
1582df0ed5 | ||
|
|
1683abc2e9 | ||
|
|
12a5c15121 | ||
|
|
8bc27bb8a1 | ||
|
|
89391279bb | ||
|
|
7f716397a0 | ||
|
|
4586f1c22c | ||
|
|
b6471f9430 | ||
|
|
380c23e469 | ||
|
|
0b67a1142f | ||
|
|
be28585294 | ||
|
|
1462844e95 | ||
|
|
9916810d18 | ||
|
|
7b81bbc791 | ||
|
|
f92b41384e | ||
|
|
5cd75c27f9 | ||
|
|
5679f7a639 | ||
|
|
25db9d0eee | ||
|
|
0178f89f2b | ||
|
|
b6dc762984 | ||
|
|
1fe10adb1e | ||
|
|
84cb273941 | ||
|
|
071eb4d58a | ||
|
|
bc1798b31b | ||
|
|
fc2aef0c3d | ||
|
|
89f94c1a6e |
+1
-1
@@ -4,7 +4,7 @@ import { PageHeader } from "@/components/layout/page-header";
|
|||||||
import { FindInPage } from "@/components/layout/find-in-page";
|
import { FindInPage } from "@/components/layout/find-in-page";
|
||||||
import { notFound } from "next/navigation";
|
import { notFound } from "next/navigation";
|
||||||
import { getBookMeta, getSingleVerse, getChapterVerseIndex } from "@/lib/api";
|
import { getBookMeta, getSingleVerse, getChapterVerseIndex } from "@/lib/api";
|
||||||
import { ChapterViewer } from "@/app/(app)/books/chapter-viewer";
|
import { ChapterViewer } from "@/app/(app)/(reader)/books/chapter-viewer";
|
||||||
import type { MobileNavGroup } from "@/components/layout/mobile-nav";
|
import type { MobileNavGroup } from "@/components/layout/mobile-nav";
|
||||||
import { ogForVerse, extractQuoteFromHl, buildOgMeta } from "@/lib/og";
|
import { ogForVerse, extractQuoteFromHl, buildOgMeta } from "@/lib/og";
|
||||||
|
|
||||||
@@ -72,11 +72,16 @@ export function BooksGrid({ books }: { books: BookInfo[] }) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const filtered = useMemo(() => {
|
const filtered = useMemo(() => {
|
||||||
if (!query.trim()) return books;
|
const base = query.trim()
|
||||||
const q = normalize(query.trim());
|
? normalizedBooks
|
||||||
return normalizedBooks
|
.filter((entry) =>
|
||||||
.filter((entry) => entry.searchText.includes(q))
|
entry.searchText.includes(normalize(query.trim())),
|
||||||
.map((entry) => entry.book);
|
)
|
||||||
|
.map((entry) => entry.book)
|
||||||
|
: books;
|
||||||
|
return [...base].sort((a, b) =>
|
||||||
|
normalize(a.title).localeCompare(normalize(b.title)),
|
||||||
|
);
|
||||||
}, [books, normalizedBooks, query]);
|
}, [books, normalizedBooks, query]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
+1
-1
@@ -12,7 +12,7 @@ import {
|
|||||||
type VerseIndexEntry,
|
type VerseIndexEntry,
|
||||||
type VerseRecord,
|
type VerseRecord,
|
||||||
} from "@/lib/api";
|
} from "@/lib/api";
|
||||||
import { ChapterViewer } from "@/app/(app)/books/chapter-viewer";
|
import { ChapterViewer } from "@/app/(app)/(reader)/books/chapter-viewer";
|
||||||
import type { MobileNavGroup } from "@/components/layout/mobile-nav";
|
import type { MobileNavGroup } from "@/components/layout/mobile-nav";
|
||||||
import { ogForVerse, extractQuoteFromHl, buildOgMeta } from "@/lib/og";
|
import { ogForVerse, extractQuoteFromHl, buildOgMeta } from "@/lib/og";
|
||||||
|
|
||||||
+1
-1
@@ -6,7 +6,7 @@ import { PageHeader } from "@/components/layout/page-header";
|
|||||||
import { FindInPage } from "@/components/layout/find-in-page";
|
import { FindInPage } from "@/components/layout/find-in-page";
|
||||||
import { notFound } from "next/navigation";
|
import { notFound } from "next/navigation";
|
||||||
import { getBookMeta, getSingleVerse, getChapterVerseIndex } from "@/lib/api";
|
import { getBookMeta, getSingleVerse, getChapterVerseIndex } from "@/lib/api";
|
||||||
import { ChapterViewer } from "@/app/(app)/books/chapter-viewer";
|
import { ChapterViewer } from "@/app/(app)/(reader)/books/chapter-viewer";
|
||||||
import type { MobileNavGroup } from "@/components/layout/mobile-nav";
|
import type { MobileNavGroup } from "@/components/layout/mobile-nav";
|
||||||
import { ogForVerse, extractQuoteFromHl, buildOgMeta } from "@/lib/og";
|
import { ogForVerse, extractQuoteFromHl, buildOgMeta } from "@/lib/og";
|
||||||
|
|
||||||
@@ -219,9 +219,17 @@ function VerseCard({
|
|||||||
Purport
|
Purport
|
||||||
</h3>
|
</h3>
|
||||||
<div className="text-base text-foreground leading-relaxed space-y-3">
|
<div className="text-base text-foreground leading-relaxed space-y-3">
|
||||||
{verse.purport.map((p, i) => (
|
{verse.purport.map((p, i) =>
|
||||||
<p key={i} dangerouslySetInnerHTML={{ __html: p }} />
|
// Cited ślokas come wrapped in <blockquote class="shloka"> — a
|
||||||
))}
|
// block element that can't live inside a <p>, so render those
|
||||||
|
// in a <div> (styled centered + accent via globals.css); plain
|
||||||
|
// prose paragraphs stay as <p>.
|
||||||
|
/^\s*<blockquote/i.test(p) ? (
|
||||||
|
<div key={i} dangerouslySetInnerHTML={{ __html: p }} />
|
||||||
|
) : (
|
||||||
|
<p key={i} dangerouslySetInnerHTML={{ __html: p }} />
|
||||||
|
),
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
+1
-1
@@ -11,7 +11,7 @@ import {
|
|||||||
type VerseIndexEntry,
|
type VerseIndexEntry,
|
||||||
type VerseRecord,
|
type VerseRecord,
|
||||||
} from "@/lib/api";
|
} from "@/lib/api";
|
||||||
import { ChapterViewer } from "@/app/(app)/books/chapter-viewer";
|
import { ChapterViewer } from "@/app/(app)/(reader)/books/chapter-viewer";
|
||||||
import type { MobileNavGroup } from "@/components/layout/mobile-nav";
|
import type { MobileNavGroup } from "@/components/layout/mobile-nav";
|
||||||
import type { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
import { ogForVerse, extractQuoteFromHl, buildOgMeta } from "@/lib/og";
|
import { ogForVerse, extractQuoteFromHl, buildOgMeta } from "@/lib/og";
|
||||||
+1
-1
@@ -15,7 +15,7 @@ import {
|
|||||||
type VerseRecord,
|
type VerseRecord,
|
||||||
} from "@/lib/api";
|
} from "@/lib/api";
|
||||||
import { ogForVerse, extractQuoteFromHl, buildOgMeta } from "@/lib/og";
|
import { ogForVerse, extractQuoteFromHl, buildOgMeta } from "@/lib/og";
|
||||||
import { ChapterViewer } from "@/app/(app)/books/chapter-viewer";
|
import { ChapterViewer } from "@/app/(app)/(reader)/books/chapter-viewer";
|
||||||
import type { MobileNavGroup } from "@/components/layout/mobile-nav";
|
import type { MobileNavGroup } from "@/components/layout/mobile-nav";
|
||||||
|
|
||||||
type NbsMeta = {
|
type NbsMeta = {
|
||||||
+1
-1
@@ -6,7 +6,7 @@ import { PageHeader } from "@/components/layout/page-header";
|
|||||||
import { FindInPage } from "@/components/layout/find-in-page";
|
import { FindInPage } from "@/components/layout/find-in-page";
|
||||||
import { notFound } from "next/navigation";
|
import { notFound } from "next/navigation";
|
||||||
import { getBookMeta, getSingleVerse, getChapterVerseIndex } from "@/lib/api";
|
import { getBookMeta, getSingleVerse, getChapterVerseIndex } from "@/lib/api";
|
||||||
import { ChapterViewer } from "@/app/(app)/books/chapter-viewer";
|
import { ChapterViewer } from "@/app/(app)/(reader)/books/chapter-viewer";
|
||||||
import type { MobileNavGroup } from "@/components/layout/mobile-nav";
|
import type { MobileNavGroup } from "@/components/layout/mobile-nav";
|
||||||
import { ogForVerse, extractQuoteFromHl, buildOgMeta } from "@/lib/og";
|
import { ogForVerse, extractQuoteFromHl, buildOgMeta } from "@/lib/og";
|
||||||
|
|
||||||
+1
-1
@@ -4,7 +4,7 @@ import { PageHeader } from "@/components/layout/page-header";
|
|||||||
import { FindInPage } from "@/components/layout/find-in-page";
|
import { FindInPage } from "@/components/layout/find-in-page";
|
||||||
import { notFound } from "next/navigation";
|
import { notFound } from "next/navigation";
|
||||||
import { getBookMeta, getSingleVerse, getChapterVerseIndex } from "@/lib/api";
|
import { getBookMeta, getSingleVerse, getChapterVerseIndex } from "@/lib/api";
|
||||||
import { ChapterViewer } from "@/app/(app)/books/chapter-viewer";
|
import { ChapterViewer } from "@/app/(app)/(reader)/books/chapter-viewer";
|
||||||
import type { MobileNavGroup } from "@/components/layout/mobile-nav";
|
import type { MobileNavGroup } from "@/components/layout/mobile-nav";
|
||||||
import { ogForVerse, extractQuoteFromHl, buildOgMeta } from "@/lib/og";
|
import { ogForVerse, extractQuoteFromHl, buildOgMeta } from "@/lib/og";
|
||||||
|
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
import { Suspense } from "react";
|
||||||
|
import { TextSelectionToolbar } from "@/components/text-selection-toolbar";
|
||||||
|
import { TextHighlighter } from "@/components/text-highlighter";
|
||||||
|
import { PageBookmarks } from "@/components/social/page-bookmarks";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reader layout — the annotation surface for the actual scripture library
|
||||||
|
* (books, letters, lectures, essays, glossary, journals, magazines, other
|
||||||
|
* documents, disciples).
|
||||||
|
*
|
||||||
|
* The text-selection toolbar and its two companions (the `?hl=` highlighter
|
||||||
|
* and the persistent in-text bookmark marks) only make sense over long-form
|
||||||
|
* scripture prose. Mounting them in this nested route group — rather than the
|
||||||
|
* parent `(app)` layout — keeps them off the home feed, search, profiles,
|
||||||
|
* settings, downloads, Kautilya, etc., so a stray text selection on chrome
|
||||||
|
* text no longer pops the toolbar.
|
||||||
|
*
|
||||||
|
* This is a route group: it adds NO path segment, so every URL underneath is
|
||||||
|
* unchanged (`/books/...`, `/letters/...`, …). All the outer `(app)` chrome
|
||||||
|
* (header, sidebar, footer, bottom nav) still wraps these pages.
|
||||||
|
*/
|
||||||
|
export default function ReaderLayout({
|
||||||
|
children,
|
||||||
|
}: {
|
||||||
|
children: React.ReactNode;
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{children}
|
||||||
|
<TextSelectionToolbar />
|
||||||
|
<Suspense fallback={null}>
|
||||||
|
<TextHighlighter />
|
||||||
|
</Suspense>
|
||||||
|
<PageBookmarks />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user