diff --git a/src/features/sections/contact/Contact.tsx b/src/features/sections/contact/Contact.tsx index 067fc2e..ef1bdea 100644 --- a/src/features/sections/contact/Contact.tsx +++ b/src/features/sections/contact/Contact.tsx @@ -1,18 +1,18 @@ "use client"; -import { useEffect, useState } from "react"; +import { useEffect } from "react"; import { profile } from "@/content/profile"; -import { liveSocials } from "@/content/socials"; +import { liveSocials, socials } from "@/content/socials"; import { CONTACT_EVENT } from "@/lib/runtime"; import { Keycap } from "@/ui/Keycap"; import { SocialIcon } from "@/ui/SocialIcon"; -import { ContactDialog } from "./ContactDialog"; -export function Contact() { - const [open, setOpen] = useState(false); +const linkedin = socials.find((s) => s.id === "linkedin")!.href; +export function Contact() { useEffect(() => { - const onOpen = () => setOpen(true); + // The 3D Enter key dispatches this from its click handler, so the popup is user-initiated. + const onOpen = () => window.open(linkedin, "_blank", "noopener,noreferrer"); window.addEventListener(CONTACT_EVENT, onOpen); return () => window.removeEventListener(CONTACT_EVENT, onOpen); }, []); @@ -39,16 +39,12 @@ export function Contact() { A role, a mission or a collaboration. Press the key, or write to me directly.

- + {profile.email} @@ -76,8 +72,6 @@ export function Contact() { Built with Next.js, React Three Fiber, Rapier & GSAP. Every key is real code.

- - setOpen(false)} /> ); } diff --git a/src/features/sections/contact/ContactDialog.tsx b/src/features/sections/contact/ContactDialog.tsx deleted file mode 100644 index f3a2301..0000000 --- a/src/features/sections/contact/ContactDialog.tsx +++ /dev/null @@ -1,90 +0,0 @@ -"use client"; - -import { useId } from "react"; -import { profile } from "@/content/profile"; -import { Dialog } from "@/ui/Dialog"; -import { Keycap } from "@/ui/Keycap"; - -const TOPICS = ["Role", "Mission", "Collab"]; - -// TODO: post to a form backend instead of opening the mail client. -export function ContactDialog({ open, onClose }: { open: boolean; onClose: () => void }) { - const titleId = useId(); - return ( - -
{ - e.preventDefault(); - const data = new FormData(e.currentTarget); - const subject = encodeURIComponent(`[${data.get("topic")}] from ${data.get("name")}`); - const body = encodeURIComponent(String(data.get("message"))); - window.location.href = `mailto:${profile.email}?subject=${subject}&body=${body}`; - onClose(); - }} - className="rounded-2xl border border-line-strong bg-surface p-6 text-left shadow-2xl" - > -
-

- Start a conversation -

- -
-
- Topic -
- {TOPICS.map((t, i) => ( - - ))} -
-
- -