chore: refactor settings route
This commit is contained in:
@@ -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 />
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user