From 77863f97beb78c9079d625436cb23d08a4c96e51 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 19 Sep 2025 18:32:38 -0500 Subject: [PATCH] Copy tooltip --- src/components/CreditsDialog.tsx | 33 +++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/src/components/CreditsDialog.tsx b/src/components/CreditsDialog.tsx index c5e88d91..37425803 100644 --- a/src/components/CreditsDialog.tsx +++ b/src/components/CreditsDialog.tsx @@ -62,6 +62,7 @@ function LightningPayment({ invoice, amount, onClose }: LightningPaymentProps) { const [qrDataUrl, setQrDataUrl] = useState(''); const [isWebLNAvailable, setIsWebLNAvailable] = useState(false); const [isPayingWithWebLN, setIsPayingWithWebLN] = useState(false); + const [showCopiedTooltip, setShowCopiedTooltip] = useState(false); const { toast } = useToast(); useEffect(() => { @@ -109,10 +110,8 @@ function LightningPayment({ invoice, amount, onClose }: LightningPaymentProps) { const handleCopyInvoice = () => { navigator.clipboard.writeText(invoice); - toast({ - title: 'Invoice copied', - description: 'Lightning invoice copied to clipboard', - }); + setShowCopiedTooltip(true); + setTimeout(() => setShowCopiedTooltip(false), 2000); }; const formatCurrency = (amount: number) => { @@ -161,15 +160,23 @@ function LightningPayment({ invoice, amount, onClose }: LightningPaymentProps) { )} - +
+ + {showCopiedTooltip && ( +
+ Copied! +
+
+ )} +
{/* Invoice Text (for manual copying) */}