diff --git a/app/src/pages/ContactPage.jsx b/app/src/pages/ContactPage.jsx new file mode 100644 index 0000000..4d22157 --- /dev/null +++ b/app/src/pages/ContactPage.jsx @@ -0,0 +1,93 @@ +import { useState } from 'react'; +import { useNav, useToast } from '../../teknav-ui.jsx'; +import { iconNode } from '../../src/lib/icon.jsx'; +import mailIcon from '../../src/assets/icons/mail.svg'; +import penLineIcon from '../../src/assets/icons/pen-line.svg'; +import mapPinIcon from '../../src/assets/icons/map-pin.svg'; +import { LegalPage, LegalSection } from './shared.jsx'; + +export function ContactPage() { + const { navigate } = useNav(); + const toast = useToast(); + const [form, setForm] = useState({ name: '', email: '', subject: '', message: '' }); + const [sent, setSent] = useState(false); + + const set = (k, v) => setForm(f => ({ ...f, [k]: v })); + + const submit = async (e) => { + e.preventDefault(); + if (!form.name.trim() || !form.email.includes('@') || !form.message.trim()) { + toast('لطفاً همه فیلدهای ضروری را پر کنید', 'error'); + return; + } + try { + await fetch('/api/v1/contact', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(form), + }); + } catch {} + setSent(true); + }; + + if (sent) return ( +
+
+
✓
+

پیام شما ارسال شد

+

ممنون از تماس شما. تیم تکناو به‌زودی پاسخ خواهد داد.

+ +
+
+ ); + + const field = { background: '#FAF7F0', border: '1px solid #D8D0C4', borderRadius: 8, padding: '11px 14px', fontSize: 14, fontFamily: 'Vazirmatn,sans-serif', color: '#263238', width: '100%', boxSizing: 'border-box', outline: 'none', direction: 'rtl' }; + + return ( + + +
+ {[ + [mailIcon, 'ایمیل عمومی', 'info@teknav.ir'], + [penLineIcon, 'همکاری محتوایی', 'admin@teknavglobal.com'], + [mapPinIcon, 'موقعیت', 'تهران، ایران'], + ].map(([icon, label, val]) => ( +
+
{iconNode(icon)}
+
{label}
+
{val}
+
+ ))} +
+
+ + +
+
+
+ + set('name', e.target.value)} placeholder="نام شما" style={field} /> +
+
+ + set('email', e.target.value)} placeholder="example@email.com" style={{ ...field, direction: 'ltr' }} /> +
+
+
+ + set('subject', e.target.value)} placeholder="موضوع پیام" style={field} /> +
+
+ +