|
|
|
@@ -83,15 +83,21 @@ function IframePage({ type, openInTab = false, className, style }: IframePagePro |
|
|
|
requestIframeUrl(); |
|
|
|
}, [type]); |
|
|
|
|
|
|
|
const hideLoading = () => { |
|
|
|
const handleLoad = () => { |
|
|
|
// setLoading(false); |
|
|
|
Loading.hide(); |
|
|
|
}; |
|
|
|
|
|
|
|
const handleError = (error?: React.SyntheticEvent<HTMLIFrameElement, Event>) => { |
|
|
|
// setLoading(false); |
|
|
|
console.log('error', error); |
|
|
|
Loading.hide(); |
|
|
|
}; |
|
|
|
|
|
|
|
return ( |
|
|
|
<div className={classNames('kf-iframe-page', className)} style={style}> |
|
|
|
{/* {loading && createPortal(<KFSpin size="large" />, document.body)} */} |
|
|
|
<FullScreenFrame url={iframeUrl} onLoad={hideLoading} onError={hideLoading} /> |
|
|
|
<FullScreenFrame url={iframeUrl} onLoad={handleLoad} onError={handleError} /> |
|
|
|
{openInTab && <FloatButton onClick={() => window.open(iframeUrl, '_blank')} />} |
|
|
|
</div> |
|
|
|
); |
|
|
|
|