mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-25 23:28:33 -06:00
more help layout
This commit is contained in:
@@ -102,10 +102,10 @@ export default function EditQuiz({
|
|||||||
}, [moduleName, quiz, quizName, quizText, updateQuizMutation]);
|
}, [moduleName, quiz, quizName, quizText, updateQuizMutation]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-full flex flex-col w-full">
|
<div className="h-full flex flex-col align-middle px-1">
|
||||||
<div className={"min-h-0 flex flex-row "}>
|
<div className={"min-h-0 flex flex-row w-full"}>
|
||||||
{showHelp && (
|
{showHelp && (
|
||||||
<pre className="flex-shrink max-w-96">
|
<pre className=" max-w-96">
|
||||||
<code>{helpString}</code>
|
<code>{helpString}</code>
|
||||||
</pre>
|
</pre>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
.monaco-editor .margin {
|
.monaco-editor .margin {
|
||||||
background-color: #18181b !important;
|
background-color: #18181b !important;
|
||||||
}
|
}
|
||||||
|
.monaco-editor { position: absolute !important; }
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
@apply text-4xl font-bold my-1;
|
@apply text-4xl font-bold my-1;
|
||||||
|
|||||||
@@ -2,10 +2,9 @@
|
|||||||
import React, { useRef, useEffect } from "react";
|
import React, { useRef, useEffect } from "react";
|
||||||
import loader from "@monaco-editor/loader";
|
import loader from "@monaco-editor/loader";
|
||||||
import { editor } from "monaco-editor/esm/vs/editor/editor.api";
|
import { editor } from "monaco-editor/esm/vs/editor/editor.api";
|
||||||
import * as monaco from 'monaco-editor';
|
import * as monaco from "monaco-editor";
|
||||||
loader.config({ monaco });
|
loader.config({ monaco });
|
||||||
|
|
||||||
|
|
||||||
export default function InnerMonacoEditor({
|
export default function InnerMonacoEditor({
|
||||||
value,
|
value,
|
||||||
onChange,
|
onChange,
|
||||||
@@ -47,11 +46,19 @@ export default function InnerMonacoEditor({
|
|||||||
}
|
}
|
||||||
}, [onChange, value]);
|
}, [onChange, value]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
window.addEventListener("resize", () => {
|
||||||
|
if (editorRef.current) {
|
||||||
|
editorRef.current.layout();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="Editor"
|
className="Editor"
|
||||||
ref={divRef}
|
ref={divRef}
|
||||||
style={{ height: "100%", overflow: "hidden" }}
|
style={{ height: "100%", overflow: "hidden"}}
|
||||||
></div>
|
></div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user