-
- )
- }
- }
-
- // This function is used for maintaining the main-graph/top-stats container height in the
- // loading process. The container height depends on how many top stat metrics are returned
- // from the API, but in the loading state, we don't know that yet. We can use localStorage
- // to keep track of the Top Stats container height.
- getTopStatsHeight() {
- if (this.props.topStatData) {
- return 'auto'
- } else {
- return `${storage.getItem(`topStatsHeight__${this.props.site.domain}`) || 89}px`
- }
- }
-
render() {
- const { mainGraphRefreshing, updateMetric, updateInterval, metric, topStatData, query, site, graphData, lastLoadTimestamp } = this.props
+ const { graphData } = this.props
const canvasClass = classNames('mt-4 select-none', { 'cursor-pointer': !['minute', 'hour'].includes(graphData?.interval) })
return (
-
+
+ )
+ }
+ }
+
+ // This function is used for maintaining the main-graph/top-stats container height in the
+ // loading process. The container height depends on how many top stat metrics are returned
+ // from the API, but in the loading state, we don't know that yet. We can use localStorage
+ // to keep track of the Top Stats container height.
+ getTopStatsHeight() {
+ if (this.state.topStatData) {
+ return 'auto'
+ } else {
+ return `${storage.getItem(`topStatsHeight__${this.props.site.domain}`) || 89}px`
+ }
+ }
renderInner() {
const { query, site } = this.props;
const { graphData, metric, topStatData, topStatsLoadingState, mainGraphLoadingState } = this.state;
- const theme = document.querySelector('html').classList.contains('dark') || false
+ const isDarkTheme = document.querySelector('html').classList.contains('dark') || false
const mainGraphRefreshing = (mainGraphLoadingState === LoadingState.refreshing)
const topStatAndGraphLoaded = !!(topStatData && graphData)
@@ -508,7 +494,19 @@ export default class VisitorGraph extends React.Component {
return (
-
+