Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

pass button classname instead of icon classname to fix padding (#7006)

Shahmir Varqhaa46d5fab5f3f
diff --git a/frontend/src/components/icons/copy-icon.tsx b/frontend/src/components/icons/copy-icon.tsx
index 4bd540ea1b..d8ebf8c967 100644
--- a/frontend/src/components/icons/copy-icon.tsx
+++ b/frontend/src/components/icons/copy-icon.tsx
@@ -11,6 +11,7 @@ import { toast } from "../ui/use-toast";
interface Props {
value: string | ((event: React.MouseEvent) => string);
className?: string;
+ buttonClassName?: string;
tooltip?: React.ReactNode | false;
toastTitle?: string;
ariaLabel?: string;
@@ -19,6 +20,7 @@ interface Props {
export const CopyClipboardIcon: React.FC<Props> = ({
value,
className,
+ buttonClassName,
tooltip,
toastTitle,
ariaLabel,
@@ -41,6 +43,7 @@ export const CopyClipboardIcon: React.FC<Props> = ({
type="button"
onClick={handleCopy}
aria-label={ariaLabel ?? "Copy to clipboard"}
+ className={buttonClassName}
>
{isCopied ? (
<CheckIcon className={cn(className, "text-(--grass-11)")} />
diff --git a/frontend/src/plugins/impl/code/any-language-editor.tsx b/frontend/src/plugins/impl/code/any-language-editor.tsx
index c1664950eb..5bbe61ae04 100644
--- a/frontend/src/plugins/impl/code/any-language-editor.tsx
+++ b/frontend/src/plugins/impl/code/any-language-editor.tsx
@@ -58,7 +58,8 @@ const AnyLanguageCodeMirror: React.FC<
{showCopyButton && !isNotSupported && (
<CopyClipboardIcon
tooltip={false}
- className="absolute top-2 right-2 p-1 hover-action z-10 text-muted-foreground"
+ buttonClassName="absolute top-2 right-2 z-10 hover-action"
+ className="h-4 w-4 text-muted-foreground"
value={props.value || ""}
toastTitle="Copied to clipboard"
/>