Skip to content

Commit 4827696

Browse files
committed
refactor(#7646): update the title source to that of frontmatter
1 parent aa5f1c6 commit 4827696

File tree

3 files changed

+3
-19
lines changed

3 files changed

+3
-19
lines changed

apps/site/components/withSidebar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type { RichTranslationValues } from 'next-intl';
77
import type { FC } from 'react';
88

99
import Link from '#site/components/Link';
10-
import { useDocumentTitle } from '#site/hooks';
10+
import { useClientContext } from '#site/hooks';
1111
import { useSiteNavigation } from '#site/hooks/server';
1212
import { useRouter } from '#site/navigation.mjs';
1313
import type { NavigationKeys } from '#site/types';
@@ -24,7 +24,7 @@ const WithSidebar: FC<WithSidebarProps> = ({ navKeys, context, ...props }) => {
2424
const locale = useLocale();
2525
const t = useTranslations();
2626
const { push } = useRouter();
27-
const pageTitle = useDocumentTitle();
27+
const { frontmatter } = useClientContext();
2828
const sideNavigation = getSideNavigation(navKeys, context);
2929

3030
const mappedSidebarItems =
@@ -42,7 +42,7 @@ const WithSidebar: FC<WithSidebarProps> = ({ navKeys, context, ...props }) => {
4242
groups={mappedSidebarItems}
4343
pathname={pathname.replace(`/${locale}`, '')}
4444
title={t('components.common.sidebar.title')}
45-
placeholder={pageTitle}
45+
placeholder={frontmatter?.title}
4646
onSelect={push}
4747
as={Link}
4848
{...props}

apps/site/hooks/react-client/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ export { default as useMediaQuery } from './useMediaQuery';
44
export { default as useNotification } from './useNotification';
55
export { default as useClientContext } from './useClientContext';
66
export { default as useNavigationState } from './useNavigationState';
7-
export { default as useDocumentTitle } from './useDocumentTitle';

apps/site/hooks/react-client/useDocumentTitle.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)