feat(render-iframe): show wait spinner until renderer is ready

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2022-10-08 17:31:29 +02:00
parent 07c77d633c
commit 34481513da

View file

@ -26,6 +26,8 @@ import { useEffectOnRenderTypeChange } from './hooks/use-effect-on-render-type-c
import { cypressAttribute, cypressId } from '../../../utils/cypress-attribute' import { cypressAttribute, cypressId } from '../../../utils/cypress-attribute'
import { getGlobalState } from '../../../redux' import { getGlobalState } from '../../../redux'
import { ORIGIN, useBaseUrl } from '../../../hooks/common/use-base-url' import { ORIGIN, useBaseUrl } from '../../../hooks/common/use-base-url'
import { ShowIf } from '../../common/show-if/show-if'
import { WaitSpinner } from '../../common/wait-spinner/wait-spinner'
export interface RenderIframeProps extends RendererProps { export interface RenderIframeProps extends RendererProps {
rendererType: RendererType rendererType: RendererType
@ -168,6 +170,9 @@ export const RenderIframe: React.FC<RenderIframeProps> = ({
return ( return (
<Fragment> <Fragment>
<CommunicatorImageLightbox /> <CommunicatorImageLightbox />
<ShowIf condition={!rendererReady}>
<WaitSpinner />
</ShowIf>
<iframe <iframe
style={{ height: `${frameHeight}px` }} style={{ height: `${frameHeight}px` }}
{...cypressId('documentIframe')} {...cypressId('documentIframe')}