Skip to content

Commit b6e86e5

Browse files
committed
tweak
1 parent 663a908 commit b6e86e5

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

frontend/src/components/CopyButton.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@ import clsx from "clsx";
33
import { CopyIcon } from "@primer/octicons-react";
44

55
interface CopyButtonProps {
6+
text: string | (() => string | Promise<string>);
67
title?: string;
78
size?: number;
8-
text: string | (() => string | Promise<string>);
9+
className?: string;
910
}
1011

1112
export default function CopyButton({
13+
text,
1214
title = "Copy",
1315
size = 16,
14-
text,
16+
className = "",
1517
}: CopyButtonProps) {
1618
const [copied, setCopied] = useState(false);
1719
const [fade, setFade] = useState(false);
@@ -40,9 +42,10 @@ export default function CopyButton({
4042
return (
4143
<>
4244
<button
43-
className={
44-
"cursor-pointer rounded px-2 hover:text-[var(--g1700)]"
45-
}
45+
className={clsx(
46+
"cursor-pointer rounded px-2 py-2 hover:bg-[var(--a50)] hover:text-[var(--g1700)]",
47+
className,
48+
)}
4649
aria-label={title}
4750
title={title}
4851
onClick={handleCopy}

frontend/src/components/Scratch/panels/AboutPanel.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export default function AboutPanel({ scratch, setScratch }: Props) {
6565
<CopyButton
6666
title="Copy Scratch link to clipboard"
6767
text={`${window.location.origin}${scratchUrl(scratch)}`}
68+
className={"ml-1"}
6869
/>
6970
</div>
7071
<div className={styles.horizontalField}>

0 commit comments

Comments
 (0)