From 662ab0537e6b7b3d15fd44b6e2695052025ed83b Mon Sep 17 00:00:00 2001 From: Lionel Han <47760119+IGoByJoe@users.noreply.github.com> Date: Sun, 31 May 2020 15:34:51 -0700 Subject: removed unecessary imports --- src/client/util/CurrentUserUtils.ts | 12 ++++++------ src/mobile/ImageUpload.tsx | 1 - src/mobile/MobileInterface.tsx | 26 +++++++++++++++++--------- 3 files changed, 23 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts index 377f908e9..1cce81ce6 100644 --- a/src/client/util/CurrentUserUtils.ts +++ b/src/client/util/CurrentUserUtils.ts @@ -614,12 +614,12 @@ export class CurrentUserUtils { /// sets up the default list of buttons to be shown in the expanding button menu at the bottom of the Dash window static setupDockedButtons(doc: Doc) { - if (doc["dockedBtn-pen"] === undefined) { - doc["dockedBtn-pen"] = CurrentUserUtils.ficon({ - onClick: ScriptField.MakeScript("activatePen(this.activePen.inkPen = sameDocs(this.activePen.inkPen, this) ? undefined : this, this.inkWidth, this.backgroundColor)"), - author: "systemTemplates", title: "ink mode", icon: "pen-nib", ischecked: ComputedField.MakeFunction(`sameDocs(this.activePen.inkPen, this)`), activePen: doc - }); - } + // if (doc["dockedBtn-pen"] === undefined) { + doc["dockedBtn-pen"] = CurrentUserUtils.ficon({ + onClick: ScriptField.MakeScript("activatePen(this.activePen.inkPen = sameDocs(this.activePen.inkPen, this) ? undefined : this, this.inkWidth, this.backgroundColor)"), + author: "systemTemplates", title: "ink mode", icon: "pen-nib", ischecked: ComputedField.MakeFunction(`sameDocs(this.activePen.inkPen, this)`), activePen: doc + }); + // } if (doc["dockedBtn-undo"] === undefined) { doc["dockedBtn-undo"] = CurrentUserUtils.ficon({ onClick: ScriptField.MakeScript("undo()"), title: "undo button", icon: "undo-alt" }); } diff --git a/src/mobile/ImageUpload.tsx b/src/mobile/ImageUpload.tsx index 2552e2112..fb0e444b5 100644 --- a/src/mobile/ImageUpload.tsx +++ b/src/mobile/ImageUpload.tsx @@ -12,7 +12,6 @@ import { observer } from 'mobx-react'; import { observable } from 'mobx'; import { Utils } from '../Utils'; import { Networking } from '../client/Network'; -import { MobileDocumentUploadContent } from '../server/Message'; export interface ImageUploadProps { Document: Doc; diff --git a/src/mobile/MobileInterface.tsx b/src/mobile/MobileInterface.tsx index 9b28d066c..4c36fdb9b 100644 --- a/src/mobile/MobileInterface.tsx +++ b/src/mobile/MobileInterface.tsx @@ -7,7 +7,7 @@ import { observer } from 'mobx-react'; import * as ReactDOM from "react-dom"; import * as rp from 'request-promise'; import { CurrentUserUtils } from '../client/util/CurrentUserUtils'; -import { FieldValue, Cast, StrCast } from '../fields/Types'; +import { FieldValue, Cast, StrCast, BoolCast } from '../fields/Types'; import { Doc, DocListCast, Opt } from '../fields/Doc'; import { Docs } from '../client/documents/Documents'; import { CollectionView } from '../client/views/collections/CollectionView'; @@ -34,20 +34,21 @@ import RichTextMenu from '../client/views/nodes/formattedText/RichTextMenu'; import { MainView } from '../client/views/MainView'; import SettingsManager from '../client/util/SettingsManager'; import { Uploader } from "./ImageUpload"; -import { Upload } from '../server/SharedMediaTypes'; import { createTypePredicateNodeWithModifier } from 'typescript'; import { AudioBox } from '../client/views/nodes/AudioBox'; import { List } from '../fields/List'; +import { ScriptField, ComputedField } from '../fields/ScriptField'; library.add(faLongArrowAltLeft); library.add(faHome); @observer -export class MobileInterface extends React.Component { +export default class MobileInterface extends React.Component { @observable static Instance: MobileInterface; @computed private get userDoc() { return Doc.UserDoc(); } @computed private get mainContainer() { return this.userDoc ? FieldValue(Cast(this.userDoc.activeMobile, Doc)) : CurrentUserUtils.GuestMobile; } @computed private get activeContainer() { return this.userDoc ? FieldValue(Cast(this.userDoc.activeMobile, Doc)) : CurrentUserUtils.GuestMobile; } + private get darkScheme() { return BoolCast(Cast(this.userDoc?.activeWorkspace, Doc, null)?.darkScheme); } // @observable private currentView: "main" | "ink" | "upload" = "main"; @observable private mainDoc: any = CurrentUserUtils.setupMobileMenu(this.userDoc); @observable private renderView?: () => JSX.Element; @@ -301,6 +302,9 @@ export class MobileInterface extends React.Component {
SettingsManager.Instance.open()}> Settings
+
CurrentUserUtils.setupDockedButtons(this._activeDoc)}> + Ink +
@@ -333,6 +337,9 @@ export class MobileInterface extends React.Component {
{buttons}
+
CurrentUserUtils.setupDockedButtons(this.userDoc)}> + Ink +
Home
@@ -493,6 +500,7 @@ export class MobileInterface extends React.Component { e.stopPropagation(); } + render() { // const content = this.currentView === "main" ? this.mainContent : // this.currentView === "ink" ? this.inkContent : @@ -505,19 +513,19 @@ export class MobileInterface extends React.Component { */} {/* */} - {this.displayWorkspaces()} + + {this.displayWorkspaces()} + {this.renderDefaultContent()} + {/* */} {/* */} {/* */} -
- {this.renderDefaultContent()} -
{/* */} {/* */} - {/* - */} + + {/* */} {/* */} -- cgit v1.2.3-70-g09d2