diff --git a/packages/frontend/src/app/validator/[hash]/BlocksChart.js b/packages/frontend/src/app/validator/[hash]/BlocksChart.js
index c2d1e7c15..f2ae698c4 100644
--- a/packages/frontend/src/app/validator/[hash]/BlocksChart.js
+++ b/packages/frontend/src/app/validator/[hash]/BlocksChart.js
@@ -1,13 +1,11 @@
+import { useState, useEffect, useRef } from 'react'
import { fetchHandlerSuccess, fetchHandlerError } from '../../../util'
-import { useState, useEffect } from 'react'
-import { LineChart } from './../../../components/charts'
+import { LineChart, TimeframeMenu } from './../../../components/charts'
import * as Api from '../../../util/Api'
import { Button } from '@chakra-ui/react'
import { CalendarIcon } from './../../../components/ui/icons'
import { ErrorMessageBlock } from '../../../components/Errors'
-import { DateRangePicker } from '../../../components/calendar'
import './TimeframeSelector.scss'
-import './TimeframeMenu.scss'
import './TabsChart.scss'
const chartConfig = {
@@ -34,13 +32,14 @@ const chartConfig = {
}
}
-const TimeframeSelector = ({ config, isActive, changeCallback, openStateCallback }) => {
+const TimeframeSelector = ({ config, isActive, changeCallback, openStateCallback, menuRef }) => {
const [timespan, setTimespan] = useState(chartConfig.timespan.values[chartConfig.timespan.defaultIndex])
const [menuIsOpen, setMenuIsOpen] = useState(false)
const changeHandler = (value) => {
setTimespan(value)
if (typeof changeCallback === 'function') changeCallback(value)
+ setMenuIsOpen(false)
}
useEffect(() => {
@@ -51,43 +50,14 @@ const TimeframeSelector = ({ config, isActive, changeCallback, openStateCallback
if (typeof openStateCallback === 'function') openStateCallback(menuIsOpen)
}, [menuIsOpen])
- const calendarHandler = (value) => {}
-
return (
-
-
-
- Select a day, period or Timeframe:
-
-
-
- {config.timespan.values.map((iTimespan, i) => (
-
- ))}
-
-
-
-
-
-
-
+