mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-01 13:47:27 +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 { styled } from '@mui/material';
|
||||||
import { usePersistentTableState } from 'hooks/usePersistentTableState';
|
import { usePersistentTableState } from 'hooks/usePersistentTableState';
|
||||||
import { allOption } from 'component/common/ProjectSelect/ProjectSelect';
|
import { allOption } from 'component/common/ProjectSelect/ProjectSelect';
|
||||||
@ -30,8 +30,6 @@ interface InsightsProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const Insights: FC<InsightsProps> = ({ withCharts = true }) => {
|
export const Insights: FC<InsightsProps> = ({ withCharts = true }) => {
|
||||||
const [scrolled, setScrolled] = useState(false);
|
|
||||||
|
|
||||||
const stateConfig = {
|
const stateConfig = {
|
||||||
project: FilterItemParam,
|
project: FilterItemParam,
|
||||||
from: withDefault(FilterItemParam, {
|
from: withDefault(FilterItemParam, {
|
||||||
@ -57,18 +55,6 @@ export const Insights: FC<InsightsProps> = ({ withCharts = true }) => {
|
|||||||
|
|
||||||
const insightsData = useInsightsData(insights, projects);
|
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 (
|
return (
|
||||||
<StyledWrapper>
|
<StyledWrapper>
|
||||||
<StickyContainer>
|
<StickyContainer>
|
||||||
|
Loading…
Reference in New Issue
Block a user