Skip to content

Commit

Permalink
docs: Fix contribution guidelines page
Browse files Browse the repository at this point in the history
  • Loading branch information
silvalaura committed Nov 12, 2024
1 parent 15fbcc2 commit 1cfd632
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/docs-contguidelines.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'react-magma-docs': patch
---

docs: Fix contribution guidelines page
8 changes: 4 additions & 4 deletions website/react-magma-docs/src/components/SubPageTabs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
);

Expand All @@ -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);

Expand All @@ -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);

Expand All @@ -133,7 +133,7 @@ export const SubPageTabs = ({ pageData, hasHorizontalNav }) => {
}
});
};
}, []);
}, [headings]);

return (
<>
Expand Down

0 comments on commit 1cfd632

Please sign in to comment.