diff options
author | alinayejin <alina_kim@brown.edu> | 2023-12-05 20:55:42 -0500 |
---|---|---|
committer | alinayejin <alina_kim@brown.edu> | 2023-12-05 20:55:42 -0500 |
commit | 1896fd1a306b95049a84d7faae10e8461fa2e3a8 (patch) | |
tree | ed53417715544dc7e07845eceb0194a7401adc48 /src | |
parent | 5ab2ac4d351f027eecc1889549c339a44b6c73fa (diff) |
start/end link event
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/collections/collectionFreeForm/CollectionFreeFormInfoUI.tsx | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormInfoUI.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormInfoUI.tsx index 2e3bfb1c7..0ec20a851 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormInfoUI.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormInfoUI.tsx @@ -30,8 +30,6 @@ export class CollectionFreeFormInfoUI extends React.Component<CollectionFreeForm this.firstDocPos = { x: NumCast(this.firstDoc.x), y: NumCast(this.firstDoc.y) }; this.message = 'Doc 1'; } else if (docs.length === 2) { - console.log('hello 1', docs[0]); - console.log('hello 2', docs[1]); this.message = 'Doc 2'; } else { this.message = 'Click anywhere and begin typing to create your first text document!'; @@ -43,7 +41,7 @@ export class CollectionFreeFormInfoUI extends React.Component<CollectionFreeForm () => ({ x: NumCast(this.firstDoc?.x), y: NumCast(this.firstDoc?.y), links: this.firstDoc && LinkManager.Instance.getAllDirectLinks(this.firstDoc) }), ({ x, y, links }) => { if ((x && x != this.firstDocPos.x) || (y && y != this.firstDocPos.y)) { - this.message = 'You moved the doc'; + this.message = 'You moved the doc.'; } if (links && links.length > 0) { this.message = 'You made your first link! You can also click the link icon to start and complete the link.'; @@ -52,17 +50,30 @@ export class CollectionFreeFormInfoUI extends React.Component<CollectionFreeForm { fireImmediately: true } ); this._disposers.reaction3 = reaction( - () => ({ activeTool: Doc.ActiveTool, linkMenu: DocumentLinksButton.LinkEditorDocView }), - ({ activeTool, linkMenu }) => { + () => ({ activeTool: Doc.ActiveTool, viewingLinks: DocumentLinksButton.LinkEditorDocView }), + ({ activeTool, viewingLinks }) => { if (activeTool == InkTool.Pen) { this.message = "You're in pen mode! Click and drag to draw your first masterpiece."; } - if (linkMenu) { - this.message = 'To edit your links, click this pencil icon.'; + if (viewingLinks) { + this.message = 'Viewing links'; + } + if (Doc.ActiveTool === InkTool.Pen) { + this.message = 'Editing links'; } }, { fireImmediately: true } ); + this._disposers.reaction4 = reaction( + () => ({ startLink: DocumentLinksButton.StartLink, endLink: Doc.UserDoc().links }), + ({ startLink, endLink }) => { + if (startLink) { + this.message = "You've started a link."; + } else if (endLink) { + this.message = "You've completed a link."; + } + } + ); } componentWillUnmount(): void { |