mirror of
https://github.com/zadam/trilium.git
synced 2025-10-19 22:58:52 +02:00
chore(collection/presentation): use note instead of note id
This commit is contained in:
parent
92e43f5210
commit
79a31421a4
@ -7,8 +7,9 @@ export default function PresentationView({ note }: ViewModeProps<{}>) {
|
||||
const containerRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
const presentationEl = buildPresentation(note.noteId);
|
||||
containerRef.current?.replaceChildren(presentationEl);
|
||||
buildPresentation(note).then(presentationEl => {
|
||||
containerRef.current?.replaceChildren(presentationEl);
|
||||
});
|
||||
}, [ note ]);
|
||||
|
||||
return <div ref={containerRef} className="presentation" />;
|
||||
|
@ -1,5 +1,13 @@
|
||||
export function buildPresentation(parentNoteId: string) {
|
||||
const p = document.createElement("p");
|
||||
p.innerHTML = "Hello world";
|
||||
return p;
|
||||
import FNote from "../../../entities/fnote";
|
||||
|
||||
export async function buildPresentation(parentNote: FNote) {
|
||||
const slides = await parentNote.getChildNotes();
|
||||
const rootElement = new DocumentFragment();
|
||||
|
||||
for (const slide of slides) {
|
||||
const slideEl = document.createElement("div");
|
||||
|
||||
}
|
||||
|
||||
return rootElement;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user