fix: fixed dark mode theme issue in single line editor

This commit is contained in:
Anoop M D
2023-01-31 21:38:11 +05:30
committed by Anoop M D
parent 61caca59ee
commit 5a78dfa210
6 changed files with 18 additions and 1 deletions

View File

@@ -22,6 +22,7 @@ class SingleLineEditor extends Component {
this.editor = CodeMirror(this.editorRef.current, {
lineWrapping: false,
lineNumbers: false,
theme: this.props.theme === 'dark' ? 'monokai' : 'default',
mode: "brunovariables",
brunoVarInfo: {
variables: getEnvironmentVariables(this.props.collection),
@@ -80,6 +81,9 @@ class SingleLineEditor extends Component {
this.editor.options.brunoVarInfo.variables = variables;
this.addOverlay();
}
if (this.props.theme !== prevProps.theme && this.editor) {
this.editor.setOption('theme', this.props.theme === 'dark' ? 'monokai' : 'default');
}
}
componentWillUnmount() {