From 04782854d25dbdaad65514a151320acc37a85758 Mon Sep 17 00:00:00 2001 From: Jeff Emmett <46964190+Jeff-Emmett@users.noreply.github.com> Date: Sat, 19 Oct 2024 23:30:04 -0400 Subject: [PATCH] fix board --- src/components/Board.tsx | 46 +--------------------------------------- 1 file changed, 1 insertion(+), 45 deletions(-) diff --git a/src/components/Board.tsx b/src/components/Board.tsx index b014085..4fe8fba 100644 --- a/src/components/Board.tsx +++ b/src/components/Board.tsx @@ -4,8 +4,6 @@ import { getHashForString, TLBookmarkAsset, Tldraw, - TLUiMenuGroup, - TLUiOverrides, } from 'tldraw' import { useParams } from 'react-router-dom' import { ChatBoxTool } from '@/tools/ChatBoxTool' @@ -45,54 +43,12 @@ export function Board() { setUserName(event.target.value); }; - const customUiOverrides: TLUiOverrides = { - ...uiOverrides, - contextMenu: (editor, contextMenuSchema, helpers) => { - const defaultContextMenu = uiOverrides.contextMenu ? uiOverrides.contextMenu(editor, contextMenuSchema, helpers) : contextMenuSchema - - const newContextMenu: TLUiMenuGroup[] = [ - ...defaultContextMenu, - { - id: 'external-link', - type: 'group', - checkbox: false, - disabled: false, - readonlyOk: true, - children: [ - { - id: 'add-external-link', - type: 'item', - readonlyOk: true, - label: 'Add External Link', - icon: 'link', - onSelect: () => { - const selectedShapes = editor.getSelectedShapes() - if (selectedShapes.length === 1) { - const shape = selectedShapes[0] - const externalUrl = `${window.location.origin}/board/${roomId}?shapeId=${shape.id}` - // Here you can implement the logic to copy the link to clipboard or show it to the user - console.log('External link:', externalUrl) - // For example, to copy to clipboard: - navigator.clipboard.writeText(externalUrl).then(() => { - editor.setToast({ id: 'external-link-copied', title: 'External link copied to clipboard' }) - }) - } - }, - }, - ], - }, - ] - - return newContextMenu - }, - } - return (
{