1
1
import { Component , Fragment } from 'react' ;
2
- // import LazyLoad from 'react-lazyload';
3
2
import type { WithRouterProps } from 'react-router' ;
4
3
import type { useSortable } from '@dnd-kit/sortable' ;
5
4
import styled from '@emotion/styled' ;
@@ -10,6 +9,7 @@ import {Alert} from 'sentry/components/alert';
10
9
import ErrorPanel from 'sentry/components/charts/errorPanel' ;
11
10
import { HeaderTitle } from 'sentry/components/charts/styles' ;
12
11
import ErrorBoundary from 'sentry/components/errorBoundary' ;
12
+ import { LazyRender } from 'sentry/components/lazyRender' ;
13
13
import ExternalLink from 'sentry/components/links/externalLink' ;
14
14
import Panel from 'sentry/components/panels/panel' ;
15
15
import PanelAlert from 'sentry/components/panels/panelAlert' ;
@@ -226,7 +226,7 @@ class WidgetCard extends Component<Props, State> {
226
226
renderErrorMessage,
227
227
tableItemLimit,
228
228
windowWidth,
229
- // noLazyLoad,
229
+ noLazyLoad,
230
230
showStoredAlert,
231
231
noDashboardsMEPProvider,
232
232
dashboardFilters,
@@ -349,8 +349,7 @@ class WidgetCard extends Component<Props, State> {
349
349
< IconWarning color = "gray500" size = "lg" />
350
350
</ StyledErrorPanel >
351
351
</ Fragment >
352
- ) : (
353
- // noLazyLoad ?
352
+ ) : noLazyLoad ? (
354
353
< WidgetCardChartContainer
355
354
location = { location }
356
355
api = { api }
@@ -365,28 +364,23 @@ class WidgetCard extends Component<Props, State> {
365
364
dashboardFilters = { dashboardFilters }
366
365
chartGroup = { DASHBOARD_CHART_GROUP }
367
366
/>
368
- // )
369
- // : (
370
- // <LazyLoad
371
- // once
372
- // resize
373
- // height={200}
374
- // >
375
- // <WidgetCardChartContainer
376
- // location={location}
377
- // api={api}
378
- // organization={organization}
379
- // selection={selection}
380
- // widget={widget}
381
- // isMobile={isMobile}
382
- // renderErrorMessage={renderErrorMessage}
383
- // tableItemLimit={tableItemLimit}
384
- // windowWidth={windowWidth}
385
- // onDataFetched={this.setData}
386
- // dashboardFilters={dashboardFilters}
387
- // chartGroup={DASHBOARD_CHART_GROUP}
388
- // />
389
- // </LazyLoad>
367
+ ) : (
368
+ < LazyRender containerHeight = { 200 } withoutContainer >
369
+ < WidgetCardChartContainer
370
+ location = { location }
371
+ api = { api }
372
+ organization = { organization }
373
+ selection = { selection }
374
+ widget = { widget }
375
+ isMobile = { isMobile }
376
+ renderErrorMessage = { renderErrorMessage }
377
+ tableItemLimit = { tableItemLimit }
378
+ windowWidth = { windowWidth }
379
+ onDataFetched = { this . setData }
380
+ dashboardFilters = { dashboardFilters }
381
+ chartGroup = { DASHBOARD_CHART_GROUP }
382
+ />
383
+ </ LazyRender >
390
384
) }
391
385
{ this . renderToolbar ( ) }
392
386
</ WidgetCardPanel >
0 commit comments