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,16 +70,17 @@ export default function CodeEditor() {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-screen flex flex-col">
|
|
||||||
<DynamicEditor
|
<DynamicEditor
|
||||||
|
defaultLanguage="c"
|
||||||
|
defaultValue="# include<stdio.h>"
|
||||||
|
path="file:///main.c"
|
||||||
theme={
|
theme={
|
||||||
resolvedTheme === "light"
|
resolvedTheme === "light"
|
||||||
? "github-light-default"
|
? "github-light-default"
|
||||||
: "github-dark-default"
|
: "github-dark-default"
|
||||||
}
|
}
|
||||||
defaultLanguage="c"
|
height="100%"
|
||||||
defaultValue="# include<stdio.h>"
|
options={{ automaticLayout: true }}
|
||||||
path="file:///main.c"
|
|
||||||
beforeMount={(monaco) => {
|
beforeMount={(monaco) => {
|
||||||
shikiToMonaco(highlighter, monaco);
|
shikiToMonaco(highlighter, monaco);
|
||||||
}}
|
}}
|
||||||
@ -88,9 +89,7 @@ export default function CodeEditor() {
|
|||||||
console.log("onValidate:", marker.message)
|
console.log("onValidate:", marker.message)
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
options={{ automaticLayout: true }}
|
|
||||||
loading={<Skeleton className="h-full w-full p-4" />}
|
loading={<Skeleton className="h-full w-full p-4" />}
|
||||||
/>
|
/>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user