diff --git a/client/web/src/pages/hacker/dashboard/DashboardPage.tsx b/client/web/src/pages/hacker/dashboard/DashboardPage.tsx index 36c8ce45..eed844a0 100644 --- a/client/web/src/pages/hacker/dashboard/DashboardPage.tsx +++ b/client/web/src/pages/hacker/dashboard/DashboardPage.tsx @@ -1,7 +1,8 @@ import type { LucideIcon } from "lucide-react"; import { BookOpen, ChevronRight, Mail, MessageSquare } from "lucide-react"; -import { useEffect, useState } from "react"; +import { useCallback, useEffect, useState } from "react"; import { Link } from "react-router"; +import { toast } from "sonner"; import { getRequest } from "@/shared/lib/api"; import type { Application, NotificationFeedItem } from "@/types"; @@ -76,6 +77,18 @@ export default function DashboardPage() { const [feed, setFeed] = useState([]); const [hackerPackURL, setHackerPackURL] = useState(""); + // Desktop browsers with no registered mail handler make the mailto: link a + // dead click, so also copy the address and confirm it. The href still fires + // for anyone who does have a mail client. + const handleCopyEmail = useCallback(async () => { + try { + await navigator.clipboard.writeText(CONTACT_EMAIL); + toast(`Copied ${CONTACT_EMAIL} to clipboard`); + } catch { + // Clipboard unavailable (insecure context or denied) — mailto: handles it + } + }, []); + useEffect(() => { const controller = new AbortController(); const load = async () => { @@ -247,7 +260,14 @@ export default function DashboardPage() { {content} ) : ( - + {content} );