mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-18 07:16:34 +00:00
feat(code-editor): refactor layout structure and improve editor height handling
This commit is contained in:
parent
423951ec58
commit
63501a3f6c
@ -70,27 +70,26 @@ export default function CodeEditor() {
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="h-screen flex flex-col">
|
||||
<DynamicEditor
|
||||
theme={
|
||||
resolvedTheme === "light"
|
||||
? "github-light-default"
|
||||
: "github-dark-default"
|
||||
}
|
||||
defaultLanguage="c"
|
||||
defaultValue="# include<stdio.h>"
|
||||
path="file:///main.c"
|
||||
beforeMount={(monaco) => {
|
||||
shikiToMonaco(highlighter, monaco);
|
||||
}}
|
||||
onValidate={(markers) => {
|
||||
markers.forEach((marker) =>
|
||||
console.log("onValidate:", marker.message)
|
||||
);
|
||||
}}
|
||||
options={{ automaticLayout: true }}
|
||||
loading={<Skeleton className="h-full w-full p-4" />}
|
||||
/>
|
||||
</div>
|
||||
<DynamicEditor
|
||||
defaultLanguage="c"
|
||||
defaultValue="# include<stdio.h>"
|
||||
path="file:///main.c"
|
||||
theme={
|
||||
resolvedTheme === "light"
|
||||
? "github-light-default"
|
||||
: "github-dark-default"
|
||||
}
|
||||
height="100%"
|
||||
options={{ automaticLayout: true }}
|
||||
beforeMount={(monaco) => {
|
||||
shikiToMonaco(highlighter, monaco);
|
||||
}}
|
||||
onValidate={(markers) => {
|
||||
markers.forEach((marker) =>
|
||||
console.log("onValidate:", marker.message)
|
||||
);
|
||||
}}
|
||||
loading={<Skeleton className="h-full w-full p-4" />}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user