fix(editor): update height classes for code editor and MDX preview components

This commit is contained in:
cfngc4594 2025-02-24 12:32:48 +08:00
parent bfb60aba6c
commit 93bcd45c8a
2 changed files with 3 additions and 3 deletions

View File

@ -102,7 +102,7 @@ export default function CodeEditor() {
defaultValue={DEFAULT_VALUE[language]} defaultValue={DEFAULT_VALUE[language]}
path={DEFAULT_PATH[language]} path={DEFAULT_PATH[language]}
theme={resolvedTheme === "light" ? "github-light-default" : "github-dark-default"} theme={resolvedTheme === "light" ? "github-light-default" : "github-dark-default"}
className="h-[calc(100vh-130px)]" className="h-full"
options={mergeOptions} options={mergeOptions}
beforeMount={(monaco) => { beforeMount={(monaco) => {
shikiToMonaco(highlighter, monaco); shikiToMonaco(highlighter, monaco);

View File

@ -79,7 +79,7 @@ export default function MdxPreview({ source }: MdxPreviewProps) {
}, [getMdxSource]); }, [getMdxSource]);
if (isLoading) { if (isLoading) {
return <Skeleton className="h-full w-full rounded-xl" />; return <Skeleton className="h-full w-full" />;
} }
if (error) { if (error) {
@ -109,7 +109,7 @@ export default function MdxPreview({ source }: MdxPreviewProps) {
} }
return ( return (
<ScrollArea className="[&>[data-radix-scroll-area-viewport]]:max-h-[calc(100vh-130px)]"> <ScrollArea className="[&>[data-radix-scroll-area-viewport]]:max-h-[calc(100vh-131px)]">
<div className="markdown-body"> <div className="markdown-body">
<MDXRemote {...mdxSource!} components={components} /> <MDXRemote {...mdxSource!} components={components} />
</div> </div>