From 7c6c035fb048f87f3a43eb627d9ad81b40ac37c4 Mon Sep 17 00:00:00 2001 From: Bobby Wang Date: Thu, 17 Nov 2022 12:57:28 +0800 Subject: [PATCH] fix diff editor dark theme ui (#955) --- src/components/CodeEditor/DiffEditor.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/CodeEditor/DiffEditor.tsx b/src/components/CodeEditor/DiffEditor.tsx index 64a9a55f..08569167 100644 --- a/src/components/CodeEditor/DiffEditor.tsx +++ b/src/components/CodeEditor/DiffEditor.tsx @@ -15,6 +15,8 @@ import useMonacoCustomizations, { } from "./useMonacoCustomizations"; import FullScreenButton from "@src/components/FullScreenButton"; import { spreadSx } from "@src/utils/ui"; +import githubLightTheme from "@src/components/CodeEditor/github-light-default.json"; +import githubDarkTheme from "@src/components/CodeEditor/github-dark-default.json"; export interface IDiffEditorProps extends Partial, @@ -73,7 +75,12 @@ export default function DiffEditor({ loading={} className="editor" {...props} + beforeMount={(monaco) => { + monaco.editor.defineTheme("github-light", githubLightTheme as any); + monaco.editor.defineTheme("github-dark", githubDarkTheme as any); + }} onMount={handleEditorMount} + theme={`github-${theme.palette.mode}`} options={ { readOnly: disabled,