Skip to content

Commit 66219aa

Browse files
committed
fix: editor overflow accounts for copy button
1 parent 53a54f5 commit 66219aa

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

src/Editor.tsx

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ export const Editor: FC = () => {
7070
}, [codeCopied]);
7171

7272
return (
73-
<ResizablePanel className="flex flex-col items-start">
73+
<ResizablePanel className="relative flex flex-col items-start">
7474
{/* EDITOR TOP BAR */}
75-
<div className="flex w-full items-center justify-between border-b border-b-surface-quaternary pr-3">
75+
<div className="flex h-12 w-full items-center justify-between border-b border-b-surface-quaternary pr-3">
7676
<div className="flex">
7777
<button className="flex w-fit min-w-[120px] items-center gap-1 border-x bg-surface-secondary px-4 py-3 text-content-primary transition-colors hover:bg-surface-tertiary">
7878
<FileJsonIcon className="w-[18px] min-w-[18px]" />
@@ -125,24 +125,25 @@ export const Editor: FC = () => {
125125
</div>
126126

127127
{/* CODE EDITOR */}
128-
<div className="relative h-full w-full overflow-y-scroll">
128+
<div className="absolute mt-12 flex h-full w-full justify-end p-3">
129129
<Button
130-
className="absolute top-3 right-3 z-10"
130+
className="z-10"
131131
variant="subtle"
132132
size="sm"
133133
onClick={onCopy}
134134
>
135135
{codeCopied ? <CheckIcon /> : <CopyIcon />} Copy
136136
</Button>
137-
<div className="h-full w-full bg-surface-secondary font-mono">
138-
<CodeEditor
139-
value={$code}
140-
onValueChange={(code) => $setCode(code)}
141-
highlight={(code) => hightlightWithLineNumbers(code, languages.hcl)}
142-
textareaId="codeArea"
143-
className="editor pt-3"
144-
/>
145-
</div>
137+
</div>
138+
139+
<div className="h-full w-full overflow-y-scroll bg-surface-secondary font-mono">
140+
<CodeEditor
141+
value={$code}
142+
onValueChange={(code) => $setCode(code)}
143+
highlight={(code) => hightlightWithLineNumbers(code, languages.hcl)}
144+
textareaId="codeArea"
145+
className="editor pt-3"
146+
/>
146147
</div>
147148
</ResizablePanel>
148149
);

0 commit comments

Comments
 (0)