Skip to content

Commit

Permalink
docs: Fix contribution guidelines page (#1548)
Browse files Browse the repository at this point in the history
  • Loading branch information
silvalaura authored Nov 13, 2024
1 parent 15fbcc2 commit 8027499
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

2 comments on commit 8027499

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.