mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-30 18:05:55 +01:00 
			
		
		
		
	fix(client/print): title interfering with presentation
This commit is contained in:
		| @@ -1,4 +1,3 @@ | |||||||
| import { JSX } from "preact/jsx-runtime"; |  | ||||||
| import FNote from "./entities/fnote"; | import FNote from "./entities/fnote"; | ||||||
| import { render } from "preact"; | import { render } from "preact"; | ||||||
| import { CustomNoteList } from "./widgets/collections/NoteList"; | import { CustomNoteList } from "./widgets/collections/NoteList"; | ||||||
| @@ -10,31 +9,26 @@ async function main() { | |||||||
|     const note = await froca.getNote(noteId); |     const note = await froca.getNote(noteId); | ||||||
|  |  | ||||||
|     if (!note) return; |     if (!note) return; | ||||||
|  |     render(getElementForNote(note), document.body); | ||||||
|     let el: JSX.Element | null = null; |  | ||||||
|     if (note.type === "book") { |  | ||||||
|         el = handleCollection(note); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     render(( |  | ||||||
|         <> |  | ||||||
|             <h1>{note.title}</h1> |  | ||||||
|             {el} |  | ||||||
|         </> |  | ||||||
|     ), document.body); |  | ||||||
| } | } | ||||||
|  |  | ||||||
| function handleCollection(note: FNote) { | function getElementForNote(note: FNote) { | ||||||
|     return ( |     // Collections. | ||||||
|         <CustomNoteList |     if (note.type === "book") { | ||||||
|  |         return <CustomNoteList | ||||||
|             isEnabled |             isEnabled | ||||||
|             note={note} |             note={note} | ||||||
|             notePath={note.getBestNotePath().join("/")} |             notePath={note.getBestNotePath().join("/")} | ||||||
|             ntxId="print" |             ntxId="print" | ||||||
|             highlightedTokens={null} |             highlightedTokens={null} | ||||||
|             media="print" |             media="print" | ||||||
|         /> |         />; | ||||||
|     ); |     } | ||||||
|  |  | ||||||
|  |     // Other note types. | ||||||
|  |     return <> | ||||||
|  |         <h1>{note.title}</h1> | ||||||
|  |     </>; | ||||||
| } | } | ||||||
|  |  | ||||||
| main(); | main(); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user