diff --git a/src/welcome/admin.js b/src/welcome/admin.js index 42a154fe3..7f7181c43 100644 --- a/src/welcome/admin.js +++ b/src/welcome/admin.js @@ -11,7 +11,7 @@ import SVGSectionIcon from './images/settings-icon-section.svg' */ import { __ } from '@wordpress/i18n' import { - useEffect, useState, useCallback, useRef, useMemo, lazy, Suspense, + useEffect, useState, useCallback, useMemo, lazy, Suspense, } from '@wordpress/element' import domReady from '@wordpress/dom-ready' import { Spinner, CheckboxControl } from '@wordpress/components' @@ -337,28 +337,9 @@ const Sidenav = ( { }, ], [] ) - const sidenavRef = useRef( null ) - - useEffect( () => { - const handleScroll = () => { - const header = document.querySelector( '.s-header-settings' ) - - if ( header ) { - // If the header is scrolled out of view, make the sidebar fixed - if ( header.getBoundingClientRect().bottom <= 32 ) { - sidenavRef.current.classList.add( 's-sidenav-fixed' ) - } else { - sidenavRef.current.classList.remove( 's-sidenav-fixed' ) - } - } - } - window.addEventListener( 'scroll', handleScroll ) - return () => window.removeEventListener( 'scroll', handleScroll ) - }, [] ) - return ( <> -