@bufferapp/analyze-shared-components
Advanced tools
Comparing version 0.36.0 to 0.37.0
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
import React, { PureComponent } from 'react'; | ||
import ReactHighcharts from 'react-highcharts'; | ||
@@ -226,35 +226,39 @@ import moment from 'moment'; | ||
const Chart = ({ | ||
data, | ||
mode, | ||
presets, | ||
profileService, | ||
pngExportId, | ||
selectedMetrics, | ||
selectedPreset, | ||
timezone, | ||
}) => { | ||
const isCustomMode = mode === 1; | ||
const charOptions = prepareChartOptions( | ||
data, | ||
isCustomMode, | ||
presets, | ||
profileService, | ||
selectedMetrics, | ||
selectedPreset, | ||
timezone, | ||
); | ||
return ( | ||
<div id={`js-dom-to-png-${pngExportId}`}> | ||
<ReactHighcharts config={charOptions} /> | ||
<Footer | ||
selectedMetrics={selectedMetrics} | ||
mode={mode} | ||
presets={presets} | ||
selectedPreset={selectedPreset} | ||
/> | ||
</div> | ||
); | ||
}; | ||
class Chart extends PureComponent { | ||
render() { | ||
const { | ||
data, | ||
mode, | ||
presets, | ||
profileService, | ||
pngExportId, | ||
selectedMetrics, | ||
selectedPreset, | ||
timezone, | ||
} = this.props; | ||
const isCustomMode = mode === 1; | ||
const charOptions = prepareChartOptions( | ||
data, | ||
isCustomMode, | ||
presets, | ||
profileService, | ||
selectedMetrics, | ||
selectedPreset, | ||
timezone, | ||
); | ||
return ( | ||
<div id={`js-dom-to-png-${pngExportId}`}> | ||
<ReactHighcharts config={charOptions} /> | ||
<Footer | ||
selectedMetrics={selectedMetrics} | ||
mode={mode} | ||
presets={presets} | ||
selectedPreset={selectedPreset} | ||
/> | ||
</div> | ||
); | ||
} | ||
} | ||
Chart.propTypes = { | ||
@@ -261,0 +265,0 @@ data: PropTypes.arrayOf(PropTypes.shape({ |
{ | ||
"name": "@bufferapp/analyze-shared-components", | ||
"version": "0.36.0", | ||
"version": "0.37.0", | ||
"description": "Shared components for Analyze", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
2157999
5869