mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 11:16:31 -05:00
feat(render-iframe): show wait spinner until renderer is ready
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
07c77d633c
commit
34481513da
1 changed files with 5 additions and 0 deletions
|
@ -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')}
|
||||||
|
|
Loading…
Reference in a new issue