From 45173e1af0793411a424c273e11a768bb877b6ba Mon Sep 17 00:00:00 2001 From: Ghadaffijr Date: Fri, 26 Jun 2026 11:30:44 +0100 Subject: [PATCH] feat: replace copied tooltip with react-hot-toast success notification - Import showToast from @/utils/toast.util in CopyField.tsx - Fire showToast.success('Address copied to clipboard', { duration: 2000 }) on copy - Retain CopySuccessAnnouncement for screen reader accessibility - Keep copied state for Check icon visual feedback on the button Closes #454 --- src/components/common/CopyField.tsx | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/components/common/CopyField.tsx b/src/components/common/CopyField.tsx index 6ecfffc..659e616 100644 --- a/src/components/common/CopyField.tsx +++ b/src/components/common/CopyField.tsx @@ -4,6 +4,7 @@ import { cn } from '@/lib/utils'; import { useAutoSelectOnFocus } from '@/hooks/useAutoSelectOnFocus'; import CopySuccessAnnouncement from '@/components/common/CopySuccessAnnouncement'; import { useCopySuccessAnnouncement } from '@/hooks/useCopySuccessAnnouncement'; +import showToast from '@/utils/toast.util'; interface CopyFieldProps { value: string; @@ -25,15 +26,16 @@ const CopyField: React.FC = ({ const { announcement, announceCopySuccess } = useCopySuccessAnnouncement(); const handleCopy = async () => { - try { - await navigator.clipboard.writeText(value); - announceCopySuccess(`${label} copied.`); - setCopied(true); - setTimeout(() => setCopied(false), 2000); - } catch { - setCopied(false); - } - }; + try { + await navigator.clipboard.writeText(value); + announceCopySuccess(`${label} copied.`); + showToast.success('Address copied to clipboard', { duration: 2000 }); + setCopied(true); + setTimeout(() => setCopied(false), 2000); + } catch { + setCopied(false); + } +}; return (