mirror of
https://github.com/zadam/trilium.git
synced 2025-10-19 06:38:59 +02:00
fix(client/print): title interfering with presentation
This commit is contained in:
parent
750c4104f7
commit
df176c4e4a
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user