From 75915bfb1699959c9684a19d93389f8a9cb4518a Mon Sep 17 00:00:00 2001 From: alinayejin Date: Wed, 6 Dec 2023 17:26:49 -0500 Subject: pins, trails, presentation mode events --- .../CollectionFreeFormInfoUI.tsx | 26 +++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'src') 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 ({ 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!'; -- cgit v1.2.3-70-g09d2