From 32065b3edacaf3667712e169e343aabba89ffbe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20H=C3=A5rek=20Andreassen?= Date: Fri, 12 Apr 2024 12:01:19 +0200 Subject: [PATCH] style: Change clicked bg color MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tim HÄrek Andreassen --- islands/CopyButton.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/islands/CopyButton.tsx b/islands/CopyButton.tsx index 8fb2e1e..70a8e5a 100644 --- a/islands/CopyButton.tsx +++ b/islands/CopyButton.tsx @@ -13,7 +13,7 @@ type Props = { } & JSX.HTMLAttributes; export default function CopyButton(props: Props) { - const { copyText, disabled = false, children, ...buttonProps } = props; + const { copyText, disabled = false, children, className = "", ...buttonProps } = props; const [clicked, setClicked] = useState(false); const startReset = () => { @@ -30,6 +30,7 @@ export default function CopyButton(props: Props) { startReset(); }} disabled={!IS_BROWSER || disabled} + className={`${className} ${clicked ? "bg-green-500" : ""}`} {...buttonProps} > {clicked