From 7fcfdaf12c3ab06ac278d6faccc9c14ef62a377d Mon Sep 17 00:00:00 2001 From: Rob Gordon Date: Wed, 9 Oct 2024 14:24:38 -0400 Subject: [PATCH] Fix Diff View Dark Mode Bug --- app/src/components/LoadTemplateDialog.tsx | 1 - app/src/components/TextEditor.tsx | 17 ++++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/src/components/LoadTemplateDialog.tsx b/app/src/components/LoadTemplateDialog.tsx index f22f5f44..06e9fc28 100644 --- a/app/src/components/LoadTemplateDialog.tsx +++ b/app/src/components/LoadTemplateDialog.tsx @@ -61,7 +61,6 @@ export function LoadTemplateDialog() { Examples diff --git a/app/src/components/TextEditor.tsx b/app/src/components/TextEditor.tsx index 2707cc2d..72c6f2ae 100644 --- a/app/src/components/TextEditor.tsx +++ b/app/src/components/TextEditor.tsx @@ -55,15 +55,22 @@ export function TextEditor({ extendOptions = {}, ...props }: TextEditorProps) { options={{ ...editorOptions, ...extendOptions, - renderSideBySide: false, + renderSideBySide: true, }} loading={} + theme={mode === "light" ? "vs" : "vs-dark"} + onMount={(_, monaco) => { + monaco.editor.setTheme(mode === "light" ? "vs" : "vs-dark"); + }} wrapperProps={{ "data-testid": "Editor", - className: classNames("bg-white dark:bg-neutral-900", { - "overflow-hidden": isDragging, - "cursor-wait pointer-events-none opacity-50": convertIsRunning, - }), + className: classNames( + "bg-white dark:bg-neutral-900 dark:text-white", + { + "overflow-hidden": isDragging, + "cursor-wait pointer-events-none opacity-50": convertIsRunning, + } + ), }} /> );