Merge pull request #2167 from croatialu/fix/traefik-config-editor-mask

fix: Optimize the code editor component, adjust the style and structu…
This commit is contained in:
Mauricio Siu
2025-07-11 22:29:23 -06:00
committed by GitHub

View File

@@ -147,7 +147,7 @@ export const CodeEditor = ({
}: Props) => { }: Props) => {
const { resolvedTheme } = useTheme(); const { resolvedTheme } = useTheme();
return ( return (
<div className={cn("relative overflow-auto", wrapperClassName)}> <div className={cn("overflow-auto", wrapperClassName)}>
<CodeMirror <CodeMirror
basicSetup={{ basicSetup={{
lineNumbers, lineNumbers,
@@ -175,14 +175,15 @@ export const CodeEditor = ({
{...props} {...props}
editable={!props.disabled} editable={!props.disabled}
className={cn( className={cn(
"w-full h-full text-sm leading-relaxed", "w-full h-full text-sm leading-relaxed relative",
`cm-theme-${resolvedTheme}`, `cm-theme-${resolvedTheme}`,
className, className,
)} )}
/> >
{props.disabled && ( {props.disabled && (
<div className="absolute top-0 rounded-md left-0 w-full h-full flex items-center justify-center z-[10] [background:var(--overlay)] h-full" /> <div className="absolute top-0 rounded-md left-0 w-full h-full flex items-center justify-center z-[10] [background:var(--overlay)] h-full" />
)} )}
</CodeMirror>
</div> </div>
); );
}; };