File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
src/core/public/overlays/banners Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 1919
2020import React , { Fragment } from 'react' ;
2121import ReactDOM from 'react-dom' ;
22- import ReactMarkdown from 'react-markdown' ;
2322import { filter } from 'rxjs/operators' ;
2423import { Subscription } from 'rxjs' ;
2524
2625import { FormattedMessage } from '@kbn/i18n/react' ;
27- import { EuiCallOut , EuiButton } from '@elastic/eui' ;
26+ import { EuiCallOut , EuiButton , EuiLoadingSpinner } from '@elastic/eui' ;
2827
2928import { I18nStart } from '../../i18n' ;
3029import { IUiSettingsClient } from '../../ui_settings' ;
@@ -36,6 +35,8 @@ interface StartDeps {
3635 uiSettings : IUiSettingsClient ;
3736}
3837
38+ const ReactMarkdownLazy = React . lazy ( ( ) => import ( 'react-markdown' ) ) ;
39+
3940/**
4041 * Sets up the custom banner that can be specified in advanced settings.
4142 * @internal
@@ -75,7 +76,15 @@ export class UserBannerService {
7576 }
7677 iconType = "help"
7778 >
78- < ReactMarkdown renderers = { { root : Fragment } } > { content . trim ( ) } </ ReactMarkdown >
79+ < React . Suspense
80+ fallback = {
81+ < div >
82+ < EuiLoadingSpinner />
83+ </ div >
84+ }
85+ >
86+ < ReactMarkdownLazy renderers = { { root : Fragment } } source = { content . trim ( ) } />
87+ </ React . Suspense >
7988
8089 < EuiButton type = "primary" size = "s" onClick = { ( ) => banners . remove ( id ! ) } >
8190 < FormattedMessage
You can’t perform that action at this time.
0 commit comments