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