Skip to content

Commit 3eeadc8

Browse files
committed
Fixes button position if chrome is shown
1 parent 8f65708 commit 3eeadc8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

apps/webapp/app/components/code/CodeBlock.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,12 @@ export const CodeBlock = forwardRef<HTMLDivElement, CodeBlockProps>(
257257
>
258258
{showChrome && <Chrome title={fileName} />}
259259
{rowTitle && <TitleRow title={rowTitle} />}
260-
<div className="absolute right-3 top-2.5 z-50 flex gap-3">
260+
<div
261+
className={cn(
262+
"absolute right-3 top-2.5 z-50 flex gap-3",
263+
showChrome ? "right-1.5 top-1.5" : "top-2.5"
264+
)}
265+
>
261266
{showCopyButton && (
262267
<TooltipProvider>
263268
<Tooltip open={copied || mouseOver} disableHoverableContent>
@@ -267,7 +272,6 @@ export const CodeBlock = forwardRef<HTMLDivElement, CodeBlockProps>(
267272
onMouseLeave={() => setMouseOver(false)}
268273
className={cn(
269274
"transition-colors duration-100 focus-custom hover:cursor-pointer",
270-
showChrome ? "top-10" : "top-2.5",
271275
copied ? "text-success" : "text-text-dimmed hover:text-text-bright"
272276
)}
273277
>

0 commit comments

Comments
 (0)