commit cal

This commit is contained in:
Jeff Emmett 2024-08-15 13:48:39 -04:00
parent 408df0d11e
commit 249031619d
2 changed files with 116 additions and 3 deletions

View File

@ -1,15 +1,29 @@
import { useLocation, useParams } from 'react-router-dom';
import { Editor, Tldraw } from "@tldraw/tldraw";
import { canvas } from "@/canvas01";
import { sharedcalendar2025 } from "@/sharedcalendar2025";
export function Board() {
const { pathname } = useLocation();
const boardId = pathname.substring(pathname.lastIndexOf('/') + 1);
const getBoard = () => {
switch (boardId) {
case 'canvas01':
return canvas;
case 'sharedcalendar2025':
return sharedcalendar2025;
default:
return canvas; // Default to canvas if no match
}
};
return (
<div className="tldraw__editor">
<Tldraw
onMount={(editor: Editor) => {
editor.putContentOntoCurrentPage(canvas as any)
editor.putContentOntoCurrentPage(getBoard() as any)
}}
/>
</div>
);
}
}

99
src/sharedcalendar2025.ts Normal file

File diff suppressed because one or more lines are too long