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:
1 parent
40d750ad4b
commit
508356b8d3
1007 files changed
+8093
-64
No files matched your search
@@ -25,15 +25,28 @@ export default function ClientLayout({ children }: { children: React.ReactNode }
|
||||
|
||||
const { fetchProfile } = useUserStore();
|
||||
const fetchSettings = useSettingsStore(state => state.fetchSettings);
|
||||
const isInitialized = useSettingsStore(state => state.isInitialized);
|
||||
|
||||
useEffect(() => {
|
||||
fetchSettings();
|
||||
const token = localStorage.getItem('accessToken');
|
||||
if (token) {
|
||||
fetchProfile().catch(e => console.error("Auth init failed:", e));
|
||||
fetchProfile().catch(e => console.error("Auth init failed:", e));
|
||||
}
|
||||
}, [fetchProfile, fetchSettings]);
|
||||
|
||||
if (!isInitialized) {
|
||||
return (
|
||||
<div className="min-h-screen bg-medical-gray-50 flex flex-col items-center justify-center font-sans" dir="rtl">
|
||||
<div className="flex flex-col items-center gap-4 text-center">
|
||||
<div className="w-12 h-12 border-4 border-canina-blue border-t-transparent rounded-full animate-spin" />
|
||||
<h2 className="text-xl font-black text-medical-gray-900 font-lalezar tracking-wide">در حال بارگذاری اطلاعات سایت...</h2>
|
||||
<p className="text-sm text-medical-gray-500 font-shabnam">لطفاً شکیبا باشید</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// Derived currentView from pathname for Header
|
||||
let currentView = "home";
|
||||
if (pathname?.includes("/shop")) currentView = "shop";
|
||||
|
||||
Reference in new issue
Block a user