fix(client/print): title interfering with presentation

This commit is contained in:
Elian Doran 2025-10-18 22:11:33 +03:00
parent 750c4104f7
commit df176c4e4a
No known key found for this signature in database

View File

@ -1,4 +1,3 @@
import { JSX } from "preact/jsx-runtime";
import FNote from "./entities/fnote";
import { render } from "preact";
import { CustomNoteList } from "./widgets/collections/NoteList";
@ -10,31 +9,26 @@ async function main() {
const note = await froca.getNote(noteId);
if (!note) return;
let el: JSX.Element | null = null;
if (note.type === "book") {
el = handleCollection(note);
}
render((
<>
<h1>{note.title}</h1>
{el}
</>
), document.body);
render(getElementForNote(note), document.body);
}
function handleCollection(note: FNote) {
return (
<CustomNoteList
function getElementForNote(note: FNote) {
// Collections.
if (note.type === "book") {
return <CustomNoteList
isEnabled
note={note}
notePath={note.getBestNotePath().join("/")}
ntxId="print"
highlightedTokens={null}
media="print"
/>
);
/>;
}
// Other note types.
return <>
<h1>{note.title}</h1>
</>;
}
main();