diff options
author | alinayejin <alina_kim@brown.edu> | 2023-12-06 17:26:49 -0500 |
---|---|---|
committer | alinayejin <alina_kim@brown.edu> | 2023-12-06 17:26:49 -0500 |
commit | 75915bfb1699959c9684a19d93389f8a9cb4518a (patch) | |
tree | 07db55b973a8b7ba806976329899aead7a1900eb /src | |
parent | 1896fd1a306b95049a84d7faae10e8461fa2e3a8 (diff) |
pins, trails, presentation mode events
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/collections/collectionFreeForm/CollectionFreeFormInfoUI.tsx | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormInfoUI.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormInfoUI.tsx index 0ec20a851..09df4bfab 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormInfoUI.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormInfoUI.tsx @@ -11,6 +11,7 @@ import { LinkManager } from '../../../util/LinkManager'; import { InkTool } from '../../../../fields/InkField'; import { LinkDocPreview } from '../../nodes/LinkDocPreview'; import { DocumentLinksButton } from '../../nodes/DocumentLinksButton'; +import { DocumentManager } from '../../../util/DocumentManager'; export interface CollectionFreeFormInfoUIProps { Document: Doc; @@ -74,13 +75,36 @@ export class CollectionFreeFormInfoUI extends React.Component<CollectionFreeForm } } ); + this._disposers.reaction5 = reaction( + () => ({ pin: Doc.ActivePresentation?.data, trails: DocumentManager.Instance.DocumentViews.find(view => view.Document === Doc.MyTrails) }), + ({ pin, trails }) => { + if (pin) { + this.message = 'You pinned your doc to a trail.'; + } + if (trails) { + this.message = 'This is your trails tab.'; + } + } + ); + this._disposers.reaction6 = reaction( + () => ({ presentationMode: Doc.ActivePresentation?.presentation_status }), + ({ presentationMode }) => { + if (presentationMode === 'edit') { + this.message = 'You are editing your presentation.'; + } else if (presentationMode === 'manual') { + this.message = 'Manual presentation mode'; + } else if (presentationMode === 'auto') { + this.message = 'Auto presentation mode'; + } + } + ); } componentWillUnmount(): void { Object.values(this._disposers).forEach(disposer => disposer?.()); } - // stop that reaction from what it's currently doing + // stop reaction from what it's currently doing // this._disposers.reaction1(); @observable message = 'Click anywhere and begin typing to create your first document!'; |