From a5406c5a5dc437e036168eb068db11d88e05bb0f Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 19 Sep 2023 08:31:08 -0300 Subject: some ui --- packages/demobank-ui/src/components/CopyButton.tsx | 102 ++++++++++----------- 1 file changed, 51 insertions(+), 51 deletions(-) (limited to 'packages/demobank-ui/src/components/CopyButton.tsx') diff --git a/packages/demobank-ui/src/components/CopyButton.tsx b/packages/demobank-ui/src/components/CopyButton.tsx index c61083074..97ccbf2bf 100644 --- a/packages/demobank-ui/src/components/CopyButton.tsx +++ b/packages/demobank-ui/src/components/CopyButton.tsx @@ -4,57 +4,57 @@ import { useEffect, useState } from "preact/hooks"; export function CopyIcon(): VNode { - return ( - - - - - ) - }; - - export function CopiedIcon(): VNode { - return ( - - - - ) - }; - -export function CopyButton({ getContent }: { getContent: () => string }): VNode { - const [copied, setCopied] = useState(false); - function copyText(): void { - navigator.clipboard.writeText(getContent() || ""); - setCopied(true); - } - useEffect(() => { - if (copied) { - setTimeout(() => { - setCopied(false); - }, 1000); - } - }, [copied]); - - if (!copied) { - return ( - - ); + return ( + + + + + ) +}; + +export function CopiedIcon(): VNode { + return ( + + + + ) +}; + +export function CopyButton({ getContent }: { getContent: () => string }): VNode { + const [copied, setCopied] = useState(false); + function copyText(): void { + navigator.clipboard.writeText(getContent() || ""); + setCopied(true); + } + useEffect(() => { + if (copied) { + setTimeout(() => { + setCopied(false); + }, 1000); } + }, [copied]); + + if (!copied) { return ( -
- -
+ ); - } \ No newline at end of file + } + return ( +
+ +
+ ); +} \ No newline at end of file -- cgit v1.2.3