gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] 01/03: allow text in copy button


From: gnunet
Subject: [taler-wallet-core] 01/03: allow text in copy button
Date: Wed, 13 Mar 2024 13:54:55 +0100

This is an automated email from the git hooks/post-receive script.

sebasjm pushed a commit to branch master
in repository wallet-core.

commit ce47869552729a996b34a0370ac44df2791b954e
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Wed Mar 13 09:44:11 2024 -0300

    allow text in copy button
---
 packages/web-util/src/components/CopyButton.tsx | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/packages/web-util/src/components/CopyButton.tsx 
b/packages/web-util/src/components/CopyButton.tsx
index fd7f8b3b4..dbb38b474 100644
--- a/packages/web-util/src/components/CopyButton.tsx
+++ b/packages/web-util/src/components/CopyButton.tsx
@@ -1,4 +1,4 @@
-import { h, VNode } from "preact";
+import { ComponentChildren, h, VNode } from "preact";
 import { useEffect, useState } from "preact/hooks";
 
 export function CopyIcon(): VNode {
@@ -17,7 +17,7 @@ export function CopiedIcon(): VNode {
   )
 };
 
-export function CopyButton({ class: clazz, getContent }: { class: string, 
getContent: () => string }): VNode {
+export function CopyButton({ class: clazz, children, getContent }: { 
children?: ComponentChildren, class: string, getContent: () => string }): VNode 
{
   const [copied, setCopied] = useState(false);
   function copyText(): void {
     if (!navigator.clipboard && !window.isSecureContext) {
@@ -43,12 +43,14 @@ export function CopyButton({ class: clazz, getContent }: { 
class: string, getCon
         copyText()
       }} >
         <CopyIcon />
+        {children}
       </button>
     );
   }
   return (
     <button class={clazz} disabled>
       <CopiedIcon />
+      {children}
     </button>
   );
 }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]