From 71d685efe96df296ad9edaeecda292b0fe3d8433 Mon Sep 17 00:00:00 2001 From: Anastasiia Date: Tue, 25 Jun 2024 13:29:10 +0700 Subject: [PATCH] MSP-3486 add theme in Editor in ConfigurationEditorCode --- src/components/ConfigurationEditorCode/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/ConfigurationEditorCode/index.tsx b/src/components/ConfigurationEditorCode/index.tsx index 891f258..9c2ded3 100644 --- a/src/components/ConfigurationEditorCode/index.tsx +++ b/src/components/ConfigurationEditorCode/index.tsx @@ -1,10 +1,12 @@ -import { FC } from 'react' +import { FC, useContext } from 'react' import { ConfigurationEditorPropsType } from '@pages/ConfigurationEditorPage' import Editor from '@monaco-editor/react' import { ConfigType } from '@pages/ModulesPage/module.type.ts' import { message } from 'antd' +import { Context } from '@stores/index.tsx' const ConfigurationEditorCode: FC = ({setDisableBtn= () => {}, bufConfig, setBufConfig }) => { + const { changeTheme } = useContext(Context) const debounce = (func: (...args: any[]) => void, wait: number) => { let timeout: NodeJS.Timeout return (...args: []) => { @@ -44,7 +46,7 @@ const ConfigurationEditorCode: FC = ({setDisableBt width="auto" height="100vh" language="json" - theme="vs-white" + theme={changeTheme ? 'vs-dark' : 'vs-white'} value={editorValue} onChange={handleChange} options={{