mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-18 07:16:34 +00:00
feat(editor): update loading state with padding and refactor dynamic import
This commit is contained in:
parent
0c1ecbcff2
commit
d89a45daa8
@ -11,6 +11,7 @@ import { connectToLanguageServer } from "@/lib/language-server";
|
|||||||
import { LanguageServerMetadata } from "@/types/language-server";
|
import { LanguageServerMetadata } from "@/types/language-server";
|
||||||
import type { MonacoLanguageClient } from "monaco-languageclient";
|
import type { MonacoLanguageClient } from "monaco-languageclient";
|
||||||
|
|
||||||
|
// Dynamically import Monaco Editor with SSR disabled
|
||||||
const Editor = dynamic(
|
const Editor = dynamic(
|
||||||
async () => {
|
async () => {
|
||||||
await import("vscode");
|
await import("vscode");
|
||||||
@ -21,7 +22,11 @@ const Editor = dynamic(
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
ssr: false,
|
ssr: false,
|
||||||
loading: () => <Skeleton className="h-full w-full rounded-3xl" />
|
loading: () => (
|
||||||
|
<div className="h-full w-full p-2">
|
||||||
|
<Skeleton className="h-full w-full rounded-3xl" />
|
||||||
|
</div>
|
||||||
|
),
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -112,7 +117,11 @@ export default function CoreEditorLsp({
|
|||||||
beforeMount={handleEditorWillMount}
|
beforeMount={handleEditorWillMount}
|
||||||
onMount={handleEditorDidMount}
|
onMount={handleEditorDidMount}
|
||||||
options={editorConfig}
|
options={editorConfig}
|
||||||
loading={<Skeleton className="h-full w-full rounded-3xl" />}
|
loading={
|
||||||
|
<div className="h-full w-full p-2">
|
||||||
|
<Skeleton className="h-full w-full rounded-3xl" />
|
||||||
|
</div>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user