Skip to content

Commit 629f51d

Browse files
authored
fix: namespace in title action (#680)
* fix: namespace in title action * fix: ns
1 parent 94192eb commit 629f51d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/components/MDXComponents/H1.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { TitleAction } from "components/Layout/TitleAction/TitleAction";
22
import { headerActions } from "./H1.module.css";
3-
import { BuildType, PathConfig } from "shared/interface";
3+
import { BuildType, PathConfig, TOCNamespace } from "shared/interface";
44

55
export const H1 = (props: {
66
children: React.ReactNode;
@@ -9,6 +9,7 @@ export const H1 = (props: {
99
pageUrl: string;
1010
buildType: BuildType;
1111
language: string;
12+
namespace?: TOCNamespace;
1213
}) => {
1314
const { children, ...restProps } = props;
1415
return (

src/components/MDXContent.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ export default function MDXContent(props: {
5656
React.useEffect(() => {
5757
// https://github.com/pingcap/website-docs/issues/221
5858
// md title with html tag will cause anchor mismatch
59-
replaceInternalHref(pathConfig.locale, pathConfig.repo, pathConfig.version || "");
59+
replaceInternalHref(
60+
pathConfig.locale,
61+
pathConfig.repo,
62+
pathConfig.version || ""
63+
);
6064
}, [pageUrl, pathConfig.locale, pathConfig.repo, pathConfig.version]);
6165

6266
// Create H1 wrapper with props
@@ -68,6 +72,7 @@ export default function MDXContent(props: {
6872
pageUrl={pageUrl}
6973
buildType={buildType}
7074
language={language}
75+
namespace={namespace}
7176
{...props}
7277
/>
7378
),

0 commit comments

Comments
 (0)