mirror of
https://github.com/Unleash/unleash.git
synced 2025-08-27 13:49:10 +02:00
Remove redundant code
This commit is contained in:
parent
898b7cd8ed
commit
3ab0358f57
@ -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<InsightsProps> = ({ withCharts = true }) => {
|
||||
const [scrolled, setScrolled] = useState(false);
|
||||
|
||||
const stateConfig = {
|
||||
project: FilterItemParam,
|
||||
from: withDefault(FilterItemParam, {
|
||||
@ -57,18 +55,6 @@ export const Insights: FC<InsightsProps> = ({ 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 (
|
||||
<StyledWrapper>
|
||||
<StickyContainer>
|
||||
|
Loading…
Reference in New Issue
Block a user