diff --git a/src/app/contacts/page.tsx b/src/app/contacts/page.tsx index 22ee0de..4559ea7 100644 --- a/src/app/contacts/page.tsx +++ b/src/app/contacts/page.tsx @@ -2,17 +2,18 @@ import type { Metadata } from 'next'; import Image from 'next/image'; import { Card } from '@/components/card'; import { PageHeader } from '@/components/page-header'; -import { ContactForm } from '@/components/contact-form'; +import { CopyEmailButton } from '@/components/copy-email-button'; + +const EMAIL = 'vreshch@gmail.com'; export const metadata: Metadata = { title: 'Contacts', description: - 'Get in touch with Volodymyr Vreshch by email or via LinkedIn, GitHub, Facebook, and Instagram, or send a message directly through the contact form.', + 'Get in touch with Volodymyr Vreshch by email or via LinkedIn, GitHub, Facebook, and Instagram.', alternates: { canonical: '/contacts' }, openGraph: { title: 'Contacts', - description: - 'Get in touch with Volodymyr Vreshch by email, LinkedIn, GitHub, and social, or send a message through the contact form.', + description: 'Get in touch with Volodymyr Vreshch by email, LinkedIn, GitHub, and social.', url: '/contacts', siteName: 'Volodymyr Vreshch', }, @@ -21,7 +22,8 @@ export const metadata: Metadata = { const contacts = [ { label: 'Email', - value: 'vreshch@gmail.com', + value: EMAIL, + href: `mailto:${EMAIL}`, icon: , iconStroke: true, }, @@ -105,8 +107,9 @@ export default function ContactsPage() { {contact.href ? ( {contact.value} @@ -122,15 +125,27 @@ export default function ContactsPage() { - {/* Contact Form */} - - - Send a message - - - - - + + + + + Let's talk + + + The fastest way to reach me is email. + + + + + Email me + + + + + ); diff --git a/src/components/contact-form.tsx b/src/components/contact-form.tsx deleted file mode 100644 index 9b35103..0000000 --- a/src/components/contact-form.tsx +++ /dev/null @@ -1,87 +0,0 @@ -'use client'; - -import { useState } from 'react'; - -const inputStyles = - 'w-full rounded-xl border-0 bg-surface px-4 py-3 text-sm text-heading placeholder:text-muted/60 focus:outline-none focus:ring-2 focus:ring-accent/40 dark:bg-dark-surface-alt dark:text-dark-text dark:placeholder:text-dark-text-secondary/40 dark:focus:ring-dark-accent/40'; - -export function ContactForm() { - const [name, setName] = useState(''); - const [email, setEmail] = useState(''); - const [message, setMessage] = useState(''); - - const handleSubmit = (e: React.FormEvent) => { - e.preventDefault(); - - const subject = encodeURIComponent(`Message from ${name || 'Website Visitor'}`); - const body = encodeURIComponent(`Name: ${name}\nEmail: ${email}\n\n${message}`); - - window.location.href = `mailto:vreshch@gmail.com?subject=${subject}&body=${body}`; - }; - - return ( - - - - - Name - - setName(e.target.value)} - required - className={inputStyles} - /> - - - - Email - - setEmail(e.target.value)} - required - className={inputStyles} - /> - - - - - Message - - setMessage(e.target.value)} - required - className={`${inputStyles} resize-none`} - /> - - - - Send Message - - - - ); -} diff --git a/src/components/copy-email-button.tsx b/src/components/copy-email-button.tsx new file mode 100644 index 0000000..69c27de --- /dev/null +++ b/src/components/copy-email-button.tsx @@ -0,0 +1,50 @@ +'use client'; + +import { useState } from 'react'; + +type CopyEmailButtonProps = { + email: string; +}; + +export function CopyEmailButton({ email }: CopyEmailButtonProps) { + const [copied, setCopied] = useState(false); + + const handleCopy = async () => { + try { + await navigator.clipboard.writeText(email); + setCopied(true); + setTimeout(() => setCopied(false), 2000); + } catch { + setCopied(false); + } + }; + + return ( + + + {copied ? ( + + ) : ( + <> + + + > + )} + + {copied ? 'Copied' : 'Copy address'} + + ); +}
+ The fastest way to reach me is email. +