From 6c7e97e2aebf79307453bcee94522381ff4c7ba7 Mon Sep 17 00:00:00 2001 From: Sophie Zhang Date: Thu, 7 Dec 2023 00:16:32 -0500 Subject: font color fix --- src/client/views/PropertiesView.tsx | 5 ++--- .../views/nodes/formattedText/FormattedTextBox.tsx | 25 ++++++++++++++++++++-- 2 files changed, 25 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx index e48574857..899cca4ec 100644 --- a/src/client/views/PropertiesView.tsx +++ b/src/client/views/PropertiesView.tsx @@ -1239,10 +1239,9 @@ export class PropertiesView extends React.Component { style={{ display: 'flex', gap: '4px', backgroundColor: this.selectedStyle === i ? StrCast(Doc.UserDoc().userVariantColor) : '#00000000' }} onClick={() => this.styleCollection(i)}>
- {ExtractColors.sortColors(style.documentsWithColors.map(doc => ExtractColors.hexToFinalColor(doc.color))).map(c => ( -
+ {ExtractColors.sortColors(style.documentsWithColors.map(doc => ExtractColors.hexToFinalColor(doc.color))).map((c, i) => ( +
))} - {/* {}}/> */} ))} {this.loadingStyles && 'Generating styles...'} diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx index 6535ac6de..5fdfbce99 100644 --- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx +++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx @@ -73,6 +73,7 @@ import applyDevTools = require('prosemirror-dev-tools'); import React = require('react'); import { media_state } from '../AudioBox'; import { setCORS } from 'google-translate-api-browser'; +import { isDarkMode } from '../../../util/reportManager/reportManagerUtils'; // setting up cors-anywhere server address const translate = setCORS('http://cors-anywhere.herokuapp.com/'); export const GoogleRef = 'googleDocId'; @@ -946,13 +947,12 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent width && layout_autoHeight && this.resetNativeHeight(scrollHeight), { fireImmediately: true } ); + this._disposers.width = reaction( + () => this.rootDoc._backgroundColor, + color => this.checkBackgroundColor() + ); this._disposers.componentHeights = reaction( // set the document height when one of the component heights changes and layout_autoHeight is on () => ({ sidebarHeight: this.sidebarHeight, textHeight: this.textHeight, layout_autoHeight: this.layout_autoHeight, marginsHeight: this.layout_autoHeightMargins }), -- cgit v1.2.3-70-g09d2