diff --git a/client/src/components/Header/components/universal-nav.tsx b/client/src/components/Header/components/universal-nav.tsx index d63ac873bce..8ffcdaf487e 100644 --- a/client/src/components/Header/components/universal-nav.tsx +++ b/client/src/components/Header/components/universal-nav.tsx @@ -23,6 +23,7 @@ type UniversalNavProps = Omit< > & { fetchState: { pending: boolean }; searchBarRef?: React.RefObject; + pathname: string; }; const UniversalNav = ({ displayMenu, @@ -31,7 +32,8 @@ const UniversalNav = ({ menuButtonRef, searchBarRef, user, - fetchState + fetchState, + pathname }: UniversalNavProps): JSX.Element => { const { pending } = fetchState; const { t } = useTranslation(); @@ -39,13 +41,11 @@ const UniversalNav = ({ query: `(min-width: ${SEARCH_EXPOSED_WIDTH}px)` }); - const search = - typeof window !== `undefined` && isLanding(window.location.pathname) ? ( - - ) : ( - - ); - + const search = isLanding(pathname) ? ( + + ) : ( + + ); return (