mirror of
https://github.com/zadam/trilium.git
synced 2025-10-19 22:58:52 +02:00
chore(collection/presentation): separate slide builder
This commit is contained in:
parent
025f22553f
commit
92e43f5210
@ -1,5 +1,15 @@
|
||||
import { useEffect, useRef, useState } from "preact/hooks";
|
||||
import { ViewModeProps } from "../interface";
|
||||
import { buildPresentation } from "./slide_builder";
|
||||
|
||||
export default function PresentationView({ }: ViewModeProps<{}>) {
|
||||
return <p>Presentation goes here.</p>;
|
||||
export default function PresentationView({ note }: ViewModeProps<{}>) {
|
||||
|
||||
const containerRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
const presentationEl = buildPresentation(note.noteId);
|
||||
containerRef.current?.replaceChildren(presentationEl);
|
||||
}, [ note ]);
|
||||
|
||||
return <div ref={containerRef} className="presentation" />;
|
||||
}
|
||||
|
@ -0,0 +1,5 @@
|
||||
export function buildPresentation(parentNoteId: string) {
|
||||
const p = document.createElement("p");
|
||||
p.innerHTML = "Hello world";
|
||||
return p;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user