aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLionel Han <47760119+IGoByJoe@users.noreply.github.com>2020-05-31 15:34:51 -0700
committerLionel Han <47760119+IGoByJoe@users.noreply.github.com>2020-05-31 15:34:51 -0700
commit662ab0537e6b7b3d15fd44b6e2695052025ed83b (patch)
tree78d97bb5e699433a4cf570bdecc8e7cc840ec047 /src
parent88593faa4777b622ed5a3208f6462cf7b307b83a (diff)
removed unecessary imports
Diffstat (limited to 'src')
-rw-r--r--src/client/util/CurrentUserUtils.ts12
-rw-r--r--src/mobile/ImageUpload.tsx1
-rw-r--r--src/mobile/MobileInterface.tsx26
3 files changed, 23 insertions, 16 deletions
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 {
<div className="item" key="settings" onClick={() => SettingsManager.Instance.open()}>
Settings
</div>
+ <div className="item" key="ink" onClick={() => CurrentUserUtils.setupDockedButtons(this._activeDoc)}>
+ Ink
+ </div>
</div>
</div>
<div>
@@ -333,6 +337,9 @@ export class MobileInterface extends React.Component {
<div>
{buttons}
</div>
+ <div className="item" key="ink" onClick={() => CurrentUserUtils.setupDockedButtons(this.userDoc)}>
+ Ink
+ </div>
<div className="item" key="home" onClick={this.returnHome}>
Home
</div>
@@ -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 {
</GestureOverlay> */}
{/* <GestureOverlay> */}
<SettingsManager />
- {this.displayWorkspaces()}
+ <GestureOverlay>
+ {this.displayWorkspaces()}
+ {this.renderDefaultContent()}
+ </GestureOverlay>
{/* </GestureOverlay> */}
{/* <DictationOverlay />
<SharingManager />
<GoogleAuthenticationManager /> */}
{/* <DocumentDecorations /> */}
- <div>
- {this.renderDefaultContent()}
- </div>
{/* <PreviewCursor /> */}
{/* <ContextMenu /> */}
- {/* <RadialMenu />
- <RichTextMenu /> */}
+ <RadialMenu />
+ {/* <RichTextMenu /> */}
{/* <PDFMenu />
<MarqueeOptionsMenu />
<OverlayView /> */}