Skip to content

Commit 90d4e21

Browse files
author
agonzalez97
committed
Changed website to match fix of quick nav
1 parent a523813 commit 90d4e21

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

website/screens/common/HeadingLink.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ type HeadingLinkProps = {
88
children: string;
99
level?: 1 | 2 | 3 | 4 | 5;
1010
as?: "h1" | "h2" | "h3" | "h4" | "h5";
11+
navSubtitle?: string;
1112
};
1213

13-
function HeadingLink({ children, level, as }: HeadingLinkProps) {
14-
const elementId = slugify(children, { lower: true });
14+
function HeadingLink({ children, level, as, navSubtitle }: HeadingLinkProps) {
15+
const elementId = slugify(navSubtitle ?? children, { lower: true });
1516
return (
1617
<HeadingLinkContainer id={elementId}>
1718
<HeadingAnchor href={`#${elementId}`}>{linkIcon}</HeadingAnchor>

website/screens/common/Section.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,24 @@ type SectionType = {
99
level?: 1 | 2 | 3 | 4 | 5;
1010
subSections?: SectionType[];
1111
children?: React.ReactNode;
12+
navSubtitle?: string;
1213
};
1314

1415
const Section = ({
1516
title,
1617
subSections,
1718
level,
1819
children,
20+
navSubtitle,
1921
}: SectionType): JSX.Element => {
2022
return (
2123
<DxcFlex
2224
direction="column"
2325
gap={level === 1 ? "3rem" : level === 2 ? "2rem" : "1.5rem"}
2426
>
25-
<HeadingLink level={level}>{title}</HeadingLink>
27+
<HeadingLink level={level} navSubtitle={navSubtitle}>
28+
{title}
29+
</HeadingLink>
2630
{children}
2731
{subSections?.map((subSection) => {
2832
return (
@@ -32,6 +36,7 @@ const Section = ({
3236
title={subSection.title}
3337
subSections={subSection.subSections}
3438
level={level + 1 <= 5 ? level + 1 : 5}
39+
navSubtitle={`${title} ${subSection.title}`}
3540
>
3641
{subSection.content}
3742
</Section>

0 commit comments

Comments
 (0)