1
- /* eslint-disable import/no-unresolved */
2
1
import React , { useRef , useState } from 'react' ;
3
2
4
3
import { EyeClosed , Telescope } from '@osrd-project/ui-icons' ;
@@ -34,9 +33,11 @@ const ManchetteWithSpaceTimeWrapper = ({
34
33
const manchetteWithSpaceTimeChartRef = useRef < HTMLDivElement > ( null ) ;
35
34
36
35
const [ activeWaypointId , setActiveWaypointPointId ] = useState < string > ( ) ;
37
- const [ activeWaypointRef , setActiveWaypointRef ] = useState < React . RefObject < HTMLDivElement > > ( ) ;
36
+ // const [activeWaypointRef, setActiveWaypointRef] = useState<React.RefObject<HTMLDivElement>>();
38
37
39
- const isElementInView = useElementInView ( activeWaypointRef , manchetteWithSpaceTimeChartRef ) ;
38
+ // const isElementInView = useElementInView(activeWaypointRef, manchetteWithSpaceTimeChartRef, {
39
+ // rootMargin: `0px 0px ${MANCHETTE_ACTIONS_HEIGHT} 0px`,
40
+ // });
40
41
41
42
const menuItems : MenuItem [ ] = [
42
43
{
@@ -58,11 +59,11 @@ const ManchetteWithSpaceTimeWrapper = ({
58
59
] ;
59
60
60
61
const handleWaypointClick = (
61
- waypointId : string ,
62
- waypointRef : React . RefObject < HTMLDivElement >
62
+ waypointId : string
63
+ // waypointRef: React.RefObject<HTMLDivElement>
63
64
) => {
64
65
setActiveWaypointPointId ( waypointId ) ;
65
- setActiveWaypointRef ( waypointRef ) ;
66
+ // setActiveWaypointRef(waypointRef);
66
67
} ;
67
68
68
69
const { manchetteProps, spaceTimeChartProps, handleScroll } = useManchettesWithSpaceTimeChart (
@@ -93,7 +94,8 @@ const ManchetteWithSpaceTimeWrapper = ({
93
94
waypointMenuData = { {
94
95
activeWaypointId,
95
96
menu : < Menu items = { menuItems } /> ,
96
- isWaypointInView : isElementInView ,
97
+ // isWaypointInView: isElementInView,
98
+ scrollableParentRef : manchetteWithSpaceTimeChartRef ,
97
99
} }
98
100
/>
99
101
< div
0 commit comments