Skip to content

Commit b0121b8

Browse files
authored
Fix <CodeEditor />'s copy button sizing to match other elements (tensorzero#3547)
1 parent 8809509 commit b0121b8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ui/app/components/ui/code-editor.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ export const CodeEditor: React.FC<CodeEditorProps> = ({
191191
return exts;
192192
}, [language, wordWrap, readOnly]);
193193

194+
const buttonClassName =
195+
"flex h-6 w-6 cursor-pointer items-center justify-center p-3 text-xs";
196+
194197
return (
195198
// `min-width: 0` If within a grid parent, prevent editor from overflowing its grid cell and force horizontal scrolling
196199
<div className={cn("group relative isolate min-w-0 rounded-sm", className)}>
@@ -199,6 +202,7 @@ export const CodeEditor: React.FC<CodeEditorProps> = ({
199202
variant="secondary"
200203
size="iconSm"
201204
onClick={() => copy(value)}
205+
className={buttonClassName}
202206
disabled={!mounted || !isCopyAvailable}
203207
title={didCopy ? "Copied!" : "Copy to clipboard"}
204208
>
@@ -209,11 +213,11 @@ export const CodeEditor: React.FC<CodeEditorProps> = ({
209213
)}
210214
</Button>
211215
<Button
212-
variant={"secondary"}
216+
variant="secondary"
213217
size="iconSm"
214218
onClick={() => toggleWordWrap()}
215219
aria-pressed={wordWrap}
216-
className="flex h-6 w-6 cursor-pointer items-center justify-center p-3 text-xs"
220+
className={buttonClassName}
217221
title="Toggle word wrap"
218222
>
219223
<span className="relative flex h-full w-full items-center justify-center">

0 commit comments

Comments
 (0)