From d92c098daa397d1eba1c43f1b0cb931058adb3e3 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Mon, 12 Jun 2023 14:14:26 -0400 Subject: [PATCH] Stop using currentProductTree in Header component (#37737) --- components/page-header/Header.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/components/page-header/Header.tsx b/components/page-header/Header.tsx index 7f5ff9558d..92e073c3d4 100644 --- a/components/page-header/Header.tsx +++ b/components/page-header/Header.tsx @@ -30,7 +30,7 @@ import styles from './Header.module.scss' export const Header = () => { const router = useRouter() const { error } = useMainContext() - const { isHomepageVersion, currentProduct, currentProductTree, allVersions } = useMainContext() + const { isHomepageVersion, currentProduct, allVersions } = useMainContext() const { currentVersion } = useVersion() const { t } = useTranslation(['header']) const isRestPage = currentProduct && currentProduct.id === 'rest' @@ -50,7 +50,8 @@ export const Header = () => { const signupCTAVisible = hasAccount === false && // don't show if `null` (currentVersion === DEFAULT_VERSION || currentVersion === 'enterprise-cloud@latest') - const productTitle = currentProductTree?.shortTitle || currentProductTree?.title + const productTitle = currentProduct?.name || null + const [windowSize, setWindowSize] = useState(0) const handleWindowResize = useCallback(() => { setWindowSize(window.innerWidth) @@ -347,14 +348,11 @@ export const Header = () => { sx={{ display: 'block' }} > - {error === '404' || - !currentProduct || - isSearchResultsPage || - !currentProductTree ? null : ( + {error === '404' || !currentProduct || isSearchResultsPage ? null : (
{productTitle}