From 22ae8111a396b82c68171d065c62f8008bcfd7ff Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+samtv12345@users.noreply.github.com> Date: Wed, 13 Mar 2024 15:20:17 +0100 Subject: [PATCH] Added monaco editor. --- admin/package.json | 2 +- admin/src/index.css | 21 ++++++++++++++++++++- admin/src/pages/SettingsPage.tsx | 11 +++++++---- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/admin/package.json b/admin/package.json index 4d5dd9631..8e390d820 100644 --- a/admin/package.json +++ b/admin/package.json @@ -10,6 +10,7 @@ "preview": "vite preview" }, "dependencies": { + "@monaco-editor/react": "^4.6.0", "@radix-ui/react-dialog": "^1.0.5", "@radix-ui/react-toast": "^1.1.5", "i18next": "^23.10.1", @@ -19,7 +20,6 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-i18next": "^14.1.0", - "react-monaco-editor": "^0.55.0", "react-router-dom": "^6.22.3", "zustand": "^4.5.2" }, diff --git a/admin/src/index.css b/admin/src/index.css index 5c7e1e975..087de1b1f 100644 --- a/admin/src/index.css +++ b/admin/src/index.css @@ -49,6 +49,14 @@ div.menu { cursor: pointer; } +.icon-button svg { + align-self: center; +} + +.icon-button span { + align-self: center; +} + div.menu span:first-child { display: flex; @@ -188,6 +196,10 @@ table { margin: 20px 0; } + + + + #available-plugins th:first-child, #available-plugins th:nth-child(2){ text-align: center; } @@ -581,7 +593,6 @@ pre { } table { - border-collapse: collapse; margin: 25px 0; font-size: 0.9em; font-family: sans-serif; @@ -589,6 +600,14 @@ table { box-shadow: 0 0 20px rgba(0, 0, 0, 0.15); } +th:first-child { + border-top-left-radius: 10px; +} + +th:last-child { + border-top-right-radius: 10px; +} + table thead tr { font-size: 25px; background-color: var(--etherpad-color); diff --git a/admin/src/pages/SettingsPage.tsx b/admin/src/pages/SettingsPage.tsx index 0905917ad..7224f950f 100644 --- a/admin/src/pages/SettingsPage.tsx +++ b/admin/src/pages/SettingsPage.tsx @@ -3,23 +3,26 @@ import {isJSONClean} from "../utils/utils.ts"; import {Trans} from "react-i18next"; import {IconButton} from "../components/IconButton.tsx"; import {RotateCw, Save} from "lucide-react"; -import Editor from 'react-monaco-editor'; +import Editor from '@monaco-editor/react'; export const SettingsPage = ()=>{ const settingsSocket = useStore(state=>state.settingsSocket) - const settings = useStore(state=>state.settings) return