From 3ab0358f578007e9d54afaddc3de4ffaf9531cd2 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Wed, 28 May 2025 08:56:46 +0200 Subject: [PATCH] Remove redundant code --- frontend/src/component/insights/Insights.tsx | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/frontend/src/component/insights/Insights.tsx b/frontend/src/component/insights/Insights.tsx index 4a73985d8b..2113543ae5 100644 --- a/frontend/src/component/insights/Insights.tsx +++ b/frontend/src/component/insights/Insights.tsx @@ -1,4 +1,4 @@ -import { useState, type FC } from 'react'; +import type { FC } from 'react'; import { styled } from '@mui/material'; import { usePersistentTableState } from 'hooks/usePersistentTableState'; import { allOption } from 'component/common/ProjectSelect/ProjectSelect'; @@ -30,8 +30,6 @@ interface InsightsProps { } export const Insights: FC = ({ withCharts = true }) => { - const [scrolled, setScrolled] = useState(false); - const stateConfig = { project: FilterItemParam, from: withDefault(FilterItemParam, { @@ -57,18 +55,6 @@ export const Insights: FC = ({ withCharts = true }) => { const insightsData = useInsightsData(insights, projects); - const handleScroll = () => { - if (!scrolled && window.scrollY > 0) { - setScrolled(true); - } else if (scrolled && window.scrollY === 0) { - setScrolled(false); - } - }; - - if (typeof window !== 'undefined') { - window.addEventListener('scroll', handleScroll); - } - return (