mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-24 20:14:35 -04:00
fix(motd): remove redundant suspense
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
6d580a0eee
commit
07c77d633c
1 changed files with 9 additions and 12 deletions
|
@ -4,11 +4,10 @@
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { Suspense, useCallback, useMemo, useEffect, useState } from 'react'
|
import React, { useCallback, useMemo, useEffect, useState } from 'react'
|
||||||
import { Button, Modal } from 'react-bootstrap'
|
import { Button, Modal } from 'react-bootstrap'
|
||||||
import { CommonModal } from '../modals/common-modal'
|
import { CommonModal } from '../modals/common-modal'
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
import { WaitSpinner } from '../wait-spinner/wait-spinner'
|
|
||||||
import { fetchMotd, MOTD_LOCAL_STORAGE_KEY } from './fetch-motd'
|
import { fetchMotd, MOTD_LOCAL_STORAGE_KEY } from './fetch-motd'
|
||||||
import { useAsync } from 'react-use'
|
import { useAsync } from 'react-use'
|
||||||
import { Logger } from '../../../utils/logger'
|
import { Logger } from '../../../utils/logger'
|
||||||
|
@ -53,16 +52,14 @@ export const MotdModal: React.FC = () => {
|
||||||
return (
|
return (
|
||||||
<CommonModal show={!!lines && !loading && !error && !dismissed} title={'motd.title'} {...cypressId('motd-modal')}>
|
<CommonModal show={!!lines && !loading && !error && !dismissed} title={'motd.title'} {...cypressId('motd-modal')}>
|
||||||
<Modal.Body className={'bg-light'}>
|
<Modal.Body className={'bg-light'}>
|
||||||
<Suspense fallback={<WaitSpinner />}>
|
<EditorToRendererCommunicatorContextProvider>
|
||||||
<EditorToRendererCommunicatorContextProvider>
|
<RenderIframe
|
||||||
<RenderIframe
|
frameClasses={'w-100'}
|
||||||
frameClasses={'w-100'}
|
rendererType={RendererType.MOTD}
|
||||||
rendererType={RendererType.MOTD}
|
markdownContentLines={lines as string[]}
|
||||||
markdownContentLines={lines as string[]}
|
adaptFrameHeightToContent={true}
|
||||||
adaptFrameHeightToContent={true}
|
/>
|
||||||
/>
|
</EditorToRendererCommunicatorContextProvider>
|
||||||
</EditorToRendererCommunicatorContextProvider>
|
|
||||||
</Suspense>
|
|
||||||
</Modal.Body>
|
</Modal.Body>
|
||||||
<Modal.Footer>
|
<Modal.Footer>
|
||||||
<Button variant={'success'} onClick={dismiss} {...testId('motd-dismiss')} {...cypressId('motd-dismiss')}>
|
<Button variant={'success'} onClick={dismiss} {...testId('motd-dismiss')} {...cypressId('motd-dismiss')}>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue