Optimised iframe for offer (#19568)

This commit is contained in:
Princi Vershwal 2024-01-24 19:20:59 +05:30 committed by GitHub
parent 384cb44e6b
commit 50495f05dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,7 +20,7 @@ const PortalFrame: React.FC<PortalFrameProps> = ({href, onDestroyed, selectedTab
if (iframeRef.current) {
setIsInvisible(false);
}
}, 500);
}, 300);
}, [iframeRef]);
useEffect(() => {
@ -50,15 +50,10 @@ const PortalFrame: React.FC<PortalFrameProps> = ({href, onDestroyed, selectedTab
}
return (
<>
{isInvisible && (
<div className="mt-[-7%] flex h-screen items-center justify-center">
<span><LoadingIndicator /></span>
</div>
) }
<>{isInvisible && <div className="mt-[-7%] flex h-screen items-center justify-center"><span><LoadingIndicator /></span></div>}
<iframe
ref={iframeRef}
className={hasLoaded && !isInvisible ? '' : 'hidden'}
className={!isInvisible && hasLoaded ? '' : 'hidden'}
data-testid="portal-preview"
height="100%"
src={href}