Home page styling

This commit is contained in:
Robert Long
2021-12-07 17:59:55 -08:00
parent 9c7006f239
commit 20350e66a2
13 changed files with 467 additions and 216 deletions

View File

@@ -4,19 +4,25 @@ import { ReactComponent as CheckIcon } from "../icons/Check.svg";
import { ReactComponent as CopyIcon } from "../icons/Copy.svg";
import { Button } from "./Button";
export function CopyButton({ value, children, ...rest }) {
export function CopyButton({ value, children, variant, ...rest }) {
const [isCopied, setCopied] = useClipboard(value, { successDuration: 3000 });
return (
<Button {...rest} variant="copy" on={isCopied} onPress={setCopied}>
<Button
{...rest}
variant={variant || "copy"}
on={isCopied}
onPress={setCopied}
iconStyle={isCopied ? "stroke" : "fill"}
>
{isCopied ? (
<>
<span>Copied!</span>
{variant !== "icon" && <span>Copied!</span>}
<CheckIcon />
</>
) : (
<>
<span>{children || value}</span>
{variant !== "icon" && <span>{children || value}</span>}
<CopyIcon />
</>
)}