From 8027499beef7534add9dd4590cece817f6f438f5 Mon Sep 17 00:00:00 2001 From: Laura Silva <91160746+silvalaura@users.noreply.github.com> Date: Wed, 13 Nov 2024 09:21:18 -0500 Subject: [PATCH] docs: Fix contribution guidelines page (#1548) --- .changeset/docs-contguidelines.md | 5 +++++ .../react-magma-docs/src/components/SubPageTabs/index.js | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 .changeset/docs-contguidelines.md diff --git a/.changeset/docs-contguidelines.md b/.changeset/docs-contguidelines.md new file mode 100644 index 000000000..8358313b1 --- /dev/null +++ b/.changeset/docs-contguidelines.md @@ -0,0 +1,5 @@ +--- +'react-magma-docs': patch +--- + +docs: Fix contribution guidelines page \ No newline at end of file diff --git a/website/react-magma-docs/src/components/SubPageTabs/index.js b/website/react-magma-docs/src/components/SubPageTabs/index.js index 7cf0716d9..6c975b74c 100644 --- a/website/react-magma-docs/src/components/SubPageTabs/index.js +++ b/website/react-magma-docs/src/components/SubPageTabs/index.js @@ -103,7 +103,7 @@ export const SubPageTabs = ({ pageData, hasHorizontalNav }) => { entries => { entries.forEach(entry => { if (entry.isIntersecting) { - const index = headings.findIndex( + const index = headings?.findIndex( page => convertTextToId(page) === entry.target.id ); @@ -114,7 +114,7 @@ export const SubPageTabs = ({ pageData, hasHorizontalNav }) => { { rootMargin: rootMarginValue } ); - headings.forEach(page => { + headings?.forEach(page => { const id = convertTextToId(page); const element = document.getElementById(id); @@ -124,7 +124,7 @@ export const SubPageTabs = ({ pageData, hasHorizontalNav }) => { }); return () => { - headings.forEach(page => { + headings?.forEach(page => { const id = convertTextToId(page); const element = document.getElementById(id); @@ -133,7 +133,7 @@ export const SubPageTabs = ({ pageData, hasHorizontalNav }) => { } }); }; - }, []); + }, [headings]); return ( <>