diff --git a/frontend/src/components/ArticleCard.tsx b/frontend/src/components/ArticleCard.tsx index f8dc1e1..aaccc5b 100644 --- a/frontend/src/components/ArticleCard.tsx +++ b/frontend/src/components/ArticleCard.tsx @@ -1,4 +1,3 @@ -import React from 'react' import { Link } from 'react-router-dom' import { ArrowLeftIcon, ClockIcon } from 'lucide-react' import type { Article } from '../data/site' @@ -11,45 +10,45 @@ export function ArticleCard({ article }: { article: Article }) { return ( -
+
{`${t('articleImagePrefix')} {/* برچسب دسته‌بندی کپسولی شیشه‌ای روی تصویر */} -
+
{article.category}
-
-

+
+

{article.title}

-

+

{article.excerpt}

-
- +
+ {lang === 'en' ? formatEnDate(article.date) : formatJalali(article.date)} - - + + {lang === 'en' ? article.read : toPersianDigits(article.read)} {/* دکمه کپسولی ادامه مطلب با افکت شیشه‌ای */} - + {t('readMore')} - +
diff --git a/frontend/src/components/ContactSection.tsx b/frontend/src/components/ContactSection.tsx index 3e45210..85551e2 100644 --- a/frontend/src/components/ContactSection.tsx +++ b/frontend/src/components/ContactSection.tsx @@ -5,6 +5,7 @@ import { Reveal } from './Reveal' import { Button } from './Button' import { useSite } from '../api' import { useLang } from '../i18n/lang' +import { track } from '../analytics' import { useFieldSaver } from '../admin/AdminContext' import { InlineEdit } from './admin/InlineEdit' import { SingletonPill } from '../admin/Editable' @@ -14,7 +15,7 @@ export function ContactSection({ bare = false }: { bare?: boolean } = {}) { const { brand, contact_section: content } = useSite() const { t } = useLang() const save = useFieldSaver() - const [form, setForm] = useState({ name: '', phone: '', note: '' }) + const [form, setForm] = useState({ name: '', phone: '', note: '', website: '' }) const [sent, setSent] = useState(false) const [sending, setSending] = useState(false) @@ -98,6 +99,8 @@ export function ContactSection({ bare = false }: { bare?: boolean } = {}) { } } + const cleanOptionalLabel = `(${content.note_optional_label?.replace(/^\(+|\)+$/g, '') || 'اختیاری'})` + return (
{!bare && ( @@ -112,8 +115,127 @@ export function ContactSection({ bare = false }: { bare?: boolean } = {}) { )} -
-
+
+ + {/* Mobile View: High-Conversion Streamlined Layout */} +
+ {/* Header */} +
+

+ saveContent('label', v)} /> +

+

+ saveContent('title', v)} /> +

+

+ saveContent('lead', v)} /> +

+
+ + {/* High-Conversion Form Box */} +
+ {sent ? ( +
+
+ +
+

+ {content.success_title} +

+

+ {content.success_text} +

+ +
+ ) : ( +
+ setForm({ ...form, website: e.target.value })} + tabIndex={-1} + autoComplete="off" + aria-hidden="true" + className="pointer-events-none absolute -left-[9999px] h-0 w-0 opacity-0" + /> +
+ + setForm({ ...form, name: e.target.value })} + placeholder={content.name_placeholder} + className="w-full py-2.5 px-3 text-xs rounded-xl border border-white/10 bg-ink/60 text-ivory placeholder:text-ivory/35 backdrop-blur-md focus:border-copper/70 focus:outline-none" + /> +
+ +
+ + setForm({ ...form, phone: e.target.value })} + placeholder={content.phone_placeholder} + className="w-full py-2.5 px-3 text-xs rounded-xl border border-white/10 bg-ink/60 text-ivory placeholder:text-ivory/35 backdrop-blur-md focus:border-copper/70 focus:outline-none text-left font-mono" + /> +
+ +
+ +