aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/MenuIconBox.tsx
diff options
context:
space:
mode:
authoranika-ahluwalia <anika.ahluwalia@gmail.com>2020-07-30 09:56:35 -0500
committeranika-ahluwalia <anika.ahluwalia@gmail.com>2020-07-30 09:56:35 -0500
commitd6aaa436f3f733166c48a1fa38ca6946f30f0bd7 (patch)
treef4bb0235d22e7b8dd790e99a0d3c1ada12e7b0ac /src/client/views/nodes/MenuIconBox.tsx
parentabb2140eb098b29e7b42b54d8e3173149c8a1123 (diff)
parent8b963a68f3e14046679bb2037f0970b017ddcb05 (diff)
merge
Diffstat (limited to 'src/client/views/nodes/MenuIconBox.tsx')
-rw-r--r--src/client/views/nodes/MenuIconBox.tsx22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/client/views/nodes/MenuIconBox.tsx b/src/client/views/nodes/MenuIconBox.tsx
index e1656fcba..0aa7b327e 100644
--- a/src/client/views/nodes/MenuIconBox.tsx
+++ b/src/client/views/nodes/MenuIconBox.tsx
@@ -2,15 +2,10 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { observer } from 'mobx-react';
import * as React from 'react';
import { createSchema, makeInterface } from '../../../fields/Schema';
+import { StrCast } from '../../../fields/Types';
import { DocComponent } from '../DocComponent';
-import './MenuIconBox.scss';
import { FieldView, FieldViewProps } from './FieldView';
-import { StrCast, Cast, NumCast } from '../../../fields/Types';
-import { Utils } from "../../../Utils";
-import { runInAction, observable, reaction, IReactionDisposer } from 'mobx';
-import { Doc } from '../../../fields/Doc';
-import { ScriptField } from '../../../fields/ScriptField';
-import { CurrentUserUtils } from '../../util/CurrentUserUtils';
+import './MenuIconBox.scss';
const MenuIconSchema = createSchema({
icon: "string"
});
@@ -24,15 +19,12 @@ export class MenuIconBox extends DocComponent<FieldViewProps, MenuIconDocument>(
render() {
- const menuBTN = <div className="menuButton" style={{ backgroundColor: CurrentUserUtils.panelContent === this.dataDoc.title ? "lightgrey" : "" }}>
+ const color = this.props.backgroundColor?.(this.props.Document) === "lightgrey" ? "black" : "white";
+ const menuBTN = <div className="menuButton" style={{ backgroundColor: this.props.backgroundColor?.(this.props.Document) }}>
<div className="menuButton-wrap"
- style={{ backgroundColor: CurrentUserUtils.panelContent === this.dataDoc.title ? "lightgrey" : "" }}
- //onPointerDown={this.dataDoc.click}
- >
- <FontAwesomeIcon className="menuButton-icon" icon={StrCast(this.dataDoc.icon, "user") as any}
- color={CurrentUserUtils.panelContent === this.dataDoc.title ? "black" : "white"} size="lg" />
- <div className="menuButton-label"
- style={{ color: CurrentUserUtils.panelContent === this.dataDoc.title ? "black" : "white" }}> {this.dataDoc.title} </div>
+ style={{ backgroundColor: this.props.backgroundColor?.(this.props.Document) }} >
+ <FontAwesomeIcon className="menuButton-icon" icon={StrCast(this.dataDoc.icon, "user") as any} color={color} size="lg" />
+ <div className="menuButton-label" style={{ color: color }}> {this.dataDoc.title} </div>
</div>
</div>;