File tree Expand file tree Collapse file tree 6 files changed +17
-8
lines changed Expand file tree Collapse file tree 6 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ import {
3131import { i18n } from '@kbn/i18n' ;
3232import { groupBy , sortBy } from 'lodash' ;
3333import React , { Fragment , useRef } from 'react' ;
34- import { useObservable } from 'react-use' ;
34+ import useObservable from 'react-use/lib/useObservable ' ;
3535import * as Rx from 'rxjs' ;
3636import { ChromeNavLink , ChromeRecentlyAccessedHistoryItem } from '../..' ;
3737import { AppCategory } from '../../../../types' ;
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ import {
2828import { i18n } from '@kbn/i18n' ;
2929import classnames from 'classnames' ;
3030import React , { createRef , useState } from 'react' ;
31- import { useObservable } from 'react-use' ;
31+ import useObservable from 'react-use/lib/useObservable ' ;
3232import { Observable } from 'rxjs' ;
3333import { LoadingIndicator } from '../' ;
3434import {
Original file line number Diff line number Diff line change 2020import { EuiHeaderBreadcrumbs } from '@elastic/eui' ;
2121import classNames from 'classnames' ;
2222import React from 'react' ;
23- import { useObservable } from 'react-use' ;
23+ import useObservable from 'react-use/lib/useObservable ' ;
2424import { Observable } from 'rxjs' ;
2525import { ChromeBreadcrumb } from '../../chrome_service' ;
2626
Original file line number Diff line number Diff line change 2020import { EuiHeaderLogo } from '@elastic/eui' ;
2121import { i18n } from '@kbn/i18n' ;
2222import React from 'react' ;
23- import { useObservable } from 'react-use' ;
23+ import useObservable from 'react-use/lib/useObservable ' ;
2424import { Observable } from 'rxjs' ;
2525import Url from 'url' ;
2626import { ChromeNavLink } from '../..' ;
Original file line number Diff line number Diff line change 1919
2020import { EuiHeaderSectionItem } from '@elastic/eui' ;
2121import React from 'react' ;
22- import { useObservable } from 'react-use' ;
22+ import useObservable from 'react-use/lib/useObservable ' ;
2323import { Observable } from 'rxjs' ;
2424import { ChromeNavControl } from '../../nav_controls' ;
2525import { HeaderExtension } from './header_extension' ;
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