()
| 113 | |
| 114 | useLayoutEffect(() => { |
| 115 | const handleResize = () => { |
| 116 | if (!tlRef.current) return; |
| 117 | |
| 118 | if (isExpanded) { |
| 119 | const newHeight = calculateHeight(); |
| 120 | gsap.set(navRef.current, { height: newHeight }); |
| 121 | |
| 122 | tlRef.current.kill(); |
| 123 | const newTl = createTimeline(); |
| 124 | if (newTl) { |
| 125 | newTl.progress(1); |
| 126 | tlRef.current = newTl; |
| 127 | } |
| 128 | } else { |
| 129 | tlRef.current.kill(); |
| 130 | const newTl = createTimeline(); |
| 131 | if (newTl) { |
| 132 | tlRef.current = newTl; |
| 133 | } |
| 134 | } |
| 135 | }; |
| 136 | |
| 137 | window.addEventListener('resize', handleResize); |
| 138 | return () => window.removeEventListener('resize', handleResize); |
nothing calls this directly
no test coverage detected