load logo in client
Build and Deploy Docker Images / build_and_deploy (push) Has been cancelled

This commit is contained in:
hamid zarghami
2026-06-03 22:25:26 +03:30
parent dc3646eef6
commit ace6a0b288
1870 changed files with 104 additions and 345 deletions
+2 -1
View File
@@ -86,7 +86,8 @@ export default function SplashScreen({
alt={restaurantName || 'Restaurant Logo'}
width={200}
height={100}
priority
unoptimized
loading="lazy"
className="object-contain"
onLoad={() => setImageLoaded(true)}
style={{ opacity: imageLoaded ? 1 : 0, transition: 'opacity 0.3s' }}
+11 -3
View File
@@ -36,9 +36,14 @@ function PreferenceWrapper({ children }: Props) {
return !sessionStorage.getItem('app-loaded') || isReload;
});
const [mounted, setMounted] = useState(false);
const [cachedLogo, setCachedLogo] = useState<string | null>(null);
const [cachedName, setCachedName] = useState<string | null>(null);
useEffect(() => {
setMounted(true);
}, []);
// بارگذاری رنگ و اطلاعات از localStorage در اولین رندر
useEffect(() => {
// بارگذاری رنگ
@@ -93,9 +98,12 @@ function PreferenceWrapper({ children }: Props) {
}
}, [showSplash]);
// استفاده از داده‌های cache شده برای اسپلش
const splashLogo = aboutData?.data?.logo || cachedLogo || undefined;
const splashName = aboutData?.data?.name || cachedName || undefined;
const splashLogo = mounted
? (aboutData?.data?.logo || cachedLogo || undefined)
: undefined;
const splashName = mounted
? (aboutData?.data?.name || cachedName || undefined)
: undefined;
return (
<>