@@ -1,4 +1,5 @@
1import { useState, useEffect, useRef } from "react";
1import { useState, useEffect, useRef } from "react";
2+import classNames from "classnames";
3export const TableOfContents = ({ staticPosition, noh3s }) => {
4export const TableOfContents = ({ staticPosition, noh3s }) => {
4 const { nestedHeadings } = useHeadingsData(noh3s);
5 const { nestedHeadings } = useHeadingsData(noh3s);
@@ -51,7 +52,7 @@ const useHeadingsData = (noh3s) => {
53const Headings = ({ headings, activeId }) => (
54const Headings = ({ headings, activeId }) => (
54− <ul>
55+ <ul className={classNames({ hidden: headings.length === 1 })}>
55 {headings.map((heading, index) => (
56 {headings.map((heading, index) => (
56 <li key={heading.id}>
57 <li key={heading.id}>