From 35d12810f6a33ea9aa983095c134631f3e2f4d37 Mon Sep 17 00:00:00 2001 From: Kevin Miller Date: Tue, 17 May 2022 09:11:44 -0700 Subject: [PATCH] chore: Remove search from mobile header --- src/components/layout/header/mobile-menu.js | 30 ------------------- .../layout/header/tools.module.scss | 0 2 files changed, 30 deletions(-) delete mode 100644 src/components/layout/header/tools.module.scss diff --git a/src/components/layout/header/mobile-menu.js b/src/components/layout/header/mobile-menu.js index 6ccae7280..6a0b23865 100644 --- a/src/components/layout/header/mobile-menu.js +++ b/src/components/layout/header/mobile-menu.js @@ -1,15 +1,10 @@ import React, { useRef, useState, useEffect } from 'react' import classNames from 'classnames' -import { useSearch } from '~context/search-context' -import HeaderSearch from './search' import HeaderNavigation from './navigation' import mobileMenuStyle from './mobile-menu.module.scss' const MobileMenu = ({ expanded, topNavigation, subNavigation, hide }) => { - const [searchState] = useSearch() - const { query, isFetching } = searchState const [menuHeight, setMenuHeight] = useState({ initial: 0, current: 0 }) - const resultPopoverRef = React.createRef() const menuRef = useRef() // Set initial menu height value to reset later. @@ -20,27 +15,6 @@ const MobileMenu = ({ expanded, topNavigation, subNavigation, hide }) => { } }, [expanded]) - // When query changes, - // either update menu min height (if needed) or reset to initial value - useEffect(() => { - if ( - query && - !isFetching && - resultPopoverRef.current && - resultPopoverRef.current.offsetHeight - ) { - setMenuHeight({ - ...menuHeight, - current: Math.max( - resultPopoverRef.current.offsetHeight + 75, - menuHeight.initial, - ), - }) - } else if (!query) { - setMenuHeight({ ...menuHeight, current: menuHeight.initial }) - } - }, [query, isFetching]) - return (
{ minHeight: `${menuHeight.current}px`, }} > -
- -
-