aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/PropertiesSection.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-10-10 12:12:14 -0400
committerbobzel <zzzman@gmail.com>2023-10-10 12:12:14 -0400
commit9f4c6d895eb6ff495a99463e8150c5d1dff26c5b (patch)
tree161d543d60ae4360bd1133cdad5283af8ab4b094 /src/client/views/PropertiesSection.tsx
parent3884211ab83db30965a4dc1c4b3133684904ebb9 (diff)
parentc9d83841221620137e89920198ffaeab2677b439 (diff)
merged with master
Diffstat (limited to 'src/client/views/PropertiesSection.tsx')
-rw-r--r--src/client/views/PropertiesSection.tsx13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/client/views/PropertiesSection.tsx b/src/client/views/PropertiesSection.tsx
index b72e048df..bd586b2f9 100644
--- a/src/client/views/PropertiesSection.tsx
+++ b/src/client/views/PropertiesSection.tsx
@@ -5,10 +5,11 @@ import { observer } from 'mobx-react';
import './PropertiesSection.scss';
import { Doc } from '../../fields/Doc';
import { StrCast } from '../../fields/Types';
+import { SettingsManager } from '../util/SettingsManager';
export interface PropertiesSectionProps {
title: string;
- content?: JSX.Element | string | null;
+ children?: JSX.Element | string | null;
isOpen: boolean;
setIsOpen: (bool: boolean) => any;
inSection?: boolean;
@@ -19,21 +20,21 @@ export interface PropertiesSectionProps {
@observer
export class PropertiesSection extends React.Component<PropertiesSectionProps> {
@computed get color() {
- return StrCast(Doc.UserDoc().userColor);
+ return SettingsManager.userColor;
}
@computed get backgroundColor() {
- return StrCast(Doc.UserDoc().userBackgroundColor);
+ return SettingsManager.userBackgroundColor;
}
@computed get variantColor() {
- return StrCast(Doc.UserDoc().userVariantColor);
+ return SettingsManager.userVariantColor;
}
@observable isDouble: boolean = false;
render() {
- if (this.props.content === undefined || this.props.content === null) return null;
+ if (this.props.children === undefined || this.props.children === null) return null;
else
return (
<div className="propertiesView-section" onPointerEnter={action(() => this.props.setInSection && this.props.setInSection(true))} onPointerLeave={action(() => this.props.setInSection && this.props.setInSection(false))}>
@@ -58,7 +59,7 @@ export class PropertiesSection extends React.Component<PropertiesSectionProps> {
<FontAwesomeIcon icon={this.props.isOpen ? 'caret-down' : 'caret-right'} size="lg" />
</div>
</div>
- {!this.props.isOpen ? null : <div className="propertiesView-content">{this.props.content}</div>}
+ {!this.props.isOpen ? null : <div className="propertiesView-content">{this.props.children}</div>}
</div>
);
}