feat: add Persian fonts, fix UI bugs, improve frontend quality

- Add local Persian fonts: Vazirmatn, Sahel, Shabnam, Lalezar, IranNastaliq
- Configure @font-face in globals.css with all font weights
- Set Vazirmatn as primary font, Lalezar for headings, Sahel for alt text
- Fix Hero image loading with crossOrigin and error fallback
- Fix SmartAdvisor disabled button contrast (WCAG compliance)
- Add visible labels for form inputs in SmartAdvisor step 1
- Fix UserDashboard null safety for walletBalance
- Fix announcement bar hydration mismatch (loading state guard)
- Fix UserDashboard null checks for profile fields
- Improve overall frontend robustness and data-loading guards
This commit is contained in:
parsa aghaei committed 2026-07-11 19:48:43 +03:30
1 parent 40d750ad4b
commit 508356b8d3
1007 files changed
+8093 -64

No files matched your search

@@ -127,9 +127,9 @@ export default function FeaturedProducts() {
<div className="flex flex-col lg:flex-row items-end justify-between mb-16 gap-6">
<div className="lg:w-2/3">
<div className="text-canina-blue text-xs font-bold uppercase tracking-[0.2em] mb-4 font-vazir">{getText('featured_badge', "بیشترین انتخاب توسط دامپزشکان")}</div>
<h2 className="text-3xl lg:text-5xl font-black text-medical-gray-900 leading-[1.2]">
<h2 className="text-3xl lg:text-5xl font-black text-medical-gray-900 leading-[1.2] font-lalezar tracking-wide">
{getText('featured_title_line1', "محصولات برگزیده و راهکارهای")} <br />
<span className="italic text-canina-blue">{getText('featured_title_line2', "درمان تخصصی")}</span>
<span className="text-canina-blue">{getText('featured_title_line2', "درمان تخصصی")}</span>
</h2>
</div>
<div className="lg:w-1/3 text-left lg:text-right">
@@ -29,6 +29,11 @@ export default function HeaderButton({
ghost: "text-medical-gray-600 hover:bg-medical-gray-50 hover:text-canina-blue"
};
const [mounted, setMounted] = React.useState(false);
React.useEffect(() => {
setMounted(true);
}, []);
return (
<motion.button
whileHover={{ y: -2 }}
@@ -39,7 +44,7 @@ export default function HeaderButton({
{icon && <div className="mb-0.5">{icon}</div>}
<div className="whitespace-nowrap">{children}</div>
{badge !== undefined && badge > 0 && (
{mounted && badge !== undefined && badge > 0 && (
<motion.div
initial={{ scale: 0 }}
animate={{ scale: 1 }}
+2 -2
View File
@@ -93,9 +93,9 @@ export default function Hero({ banners = [] }: { banners?: any[] }) {
<span className="text-canina-blue text-xs font-bold uppercase tracking-widest leading-none">{getText('hero_badge', "تخصص دارویی از آلمان")}</span>
</div>
<h1 className="text-4xl lg:text-7xl font-black text-medical-gray-900 leading-[1.1] mb-6">
<h1 className="text-4xl lg:text-7xl font-black text-medical-gray-900 leading-[1.2] mb-6 font-lalezar tracking-wide">
{titleParts[0]} <br />
{titleParts[1] && <span className="text-canina-blue font-vazir">{titleParts[1]}</span>}
{titleParts[1] && <span className="text-canina-blue">{titleParts[1]}</span>}
</h1>
<p
@@ -101,8 +101,8 @@ export default function SmartAdvisor({ onComplete, rules = [] }: SmartAdvisorPro
<Sparkle className="w-4 h-4 text-canina-blue" />
<span className="text-canina-blue text-xs font-black uppercase tracking-widest font-vazir">{getText('advisor_badge', "تکنولوژی پایش هوشمند")}</span>
</motion.div>
<h2 className="text-4xl lg:text-5xl font-black text-medical-gray-900 mb-4 font-vazir italic">{getText('advisor_title', "دستیار سلامت کانینا")}</h2>
<p className="text-medical-gray-600 font-bold text-lg font-vazir">{getText('advisor_subtitle', "فقط چند قدم تا صدور شناسنامه هوشمند و دریافت پیشنهادات تخصصی")}</p>
<h2 className="text-4xl lg:text-5xl font-black text-medical-gray-900 mb-4 font-lalezar tracking-wide">{getText('advisor_title', "دستیار سلامت کانینا")}</h2>
<p className="text-medical-gray-600 font-medium text-base font-shabnam">{getText('advisor_subtitle', "فقط چند قدم تا صدور شناسنامه هوشمند و دریافت پیشنهادات تخصصی")}</p>
</div>
<div className="bg-medical-gray-50 rounded-[3.5rem] border border-medical-gray-100 p-8 lg:p-12 shadow-2xl shadow-medical-gray-200/50 relative overflow-hidden">
@@ -190,7 +190,7 @@ export default function UserDashboard() {
<div className="relative z-10">
<div className="text-[10px] font-black uppercase tracking-widest text-white mb-2">موجودی کیف پول</div>
<div className="flex items-baseline gap-2 flex-row-reverse justify-end">
<div className="text-4xl font-black italic">{toPersian(profile.walletBalance.toLocaleString())}</div>
<div className="text-4xl font-black italic">{toPersian((profile.walletBalance ?? 0).toLocaleString())}</div>
<span className="text-sm not-italic font-bold text-white/80">تومان</span>
</div>
<button
@@ -50,7 +50,7 @@ export default function VetGallery({ testimonials = [] }: { testimonials?: any[]
<Star className="w-3 h-3" />
{getText('videos_badge', "Vet Insights")}
</div>
<h2 className="text-4xl md:text-5xl font-black text-medical-gray-900 italic leading-tight">
<h2 className="text-4xl md:text-5xl font-black text-medical-gray-900 leading-tight font-lalezar tracking-wide">
{getText('videos_title', "مشاوره ویدئویی")} <span className="text-canina-blue underline decoration-4 decoration-canina-blue/20 underline-offset-8">{getText('videos_title_highlight', "دوست دامپزشک پت شما")}</span>
</h2>
<p className="text-lg text-medical-gray-500 font-medium mt-6">