aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/PropertiesSection.tsx
diff options
context:
space:
mode:
authorSophie Zhang <sophie_zhang@brown.edu>2023-09-26 16:49:43 -0400
committerSophie Zhang <sophie_zhang@brown.edu>2023-09-26 16:49:43 -0400
commitf2958fd4d7dab5369c9e68c5d8f3b50332391aac (patch)
tree633e77c196ad4c8c51fb7244e4af22c88168e10d /src/client/views/PropertiesSection.tsx
parentaa3dc83bdd723db2597dc36fe09ae288ce3641da (diff)
parent78edc744c77e378728d033001331737df0b2f393 (diff)
Merge branch 'master' into sophie-ai-images
Diffstat (limited to 'src/client/views/PropertiesSection.tsx')
-rw-r--r--src/client/views/PropertiesSection.tsx16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/client/views/PropertiesSection.tsx b/src/client/views/PropertiesSection.tsx
index 6fab0168b..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))}>
@@ -49,7 +50,8 @@ export class PropertiesSection extends React.Component<PropertiesSectionProps> {
this.props.setIsOpen(!this.props.isOpen);
})}
style={{
- background: this.props.isOpen ? this.variantColor : this.backgroundColor,
+ background: this.variantColor,
+ // this.props.isOpen ? this.variantColor : this.backgroundColor,
color: this.color,
}}>
{this.props.title}
@@ -57,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>
);
}