style: Change clicked bg color
Signed-off-by: Tim Hårek Andreassen <tim@harek.no>
This commit is contained in:
parent
3c3a847668
commit
32065b3eda
|
|
@ -13,7 +13,7 @@ type Props = {
|
|||
} & JSX.HTMLAttributes<HTMLButtonElement>;
|
||||
|
||||
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
|
||||
|
|
|
|||
Loading…
Reference in New Issue