Skip to content

Commit 12a6a01

Browse files
committed
Adapt YAML editor theme to MUI palette mode
The YAML editor now uses the 'vs' theme in light mode and 'vs-dark' in dark mode, based on the current MUI theme. This improves visual consistency with the application's overall appearance.
1 parent dc73f81 commit 12a6a01

File tree

1 file changed

+3
-2
lines changed
  • console/ui/src/widgets/yaml-editor-form/ui

1 file changed

+3
-2
lines changed

console/ui/src/widgets/yaml-editor-form/ui/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
} from '@widgets/yaml-editor-form/modal/const.ts';
1414
import { YamlEditorFormValues } from '@widgets/yaml-editor-form/modal/types.ts';
1515
import { RequestClusterCreate, usePostClustersMutation } from '@/shared/api/api/clusters';
16-
import { Box, Stack } from '@mui/material';
16+
import { Box, Stack, useTheme } from '@mui/material';
1717
import { toast } from 'react-toastify';
1818
import * as YAML from 'yaml';
1919
import ErrorBox from '@shared/ui/error-box/ui';
@@ -25,6 +25,7 @@ import { selectCurrentProject } from '@app/redux/slices/projectSlice/projectSele
2525
import IStandaloneCodeEditor = editor.IStandaloneCodeEditor;
2626

2727
const YamlEditorForm: FC = () => {
28+
const theme = useTheme();
2829
const { t } = useTranslation('clusters');
2930
const editorRef = useRef<IStandaloneCodeEditor | null>(null);
3031
const navigate = useNavigate();
@@ -85,7 +86,7 @@ const YamlEditorForm: FC = () => {
8586
defaultLanguage="yaml"
8687
height="75vh"
8788
onMount={handleEditorDidMount}
88-
theme="vs-dark"
89+
theme={theme.palette.mode === 'light' ? 'vs' : 'vs-dark'}
8990
/>
9091
)}
9192
/>

0 commit comments

Comments
 (0)