From 7c744961494ca80f82b3ad66c98ff0a1c0496db7 Mon Sep 17 00:00:00 2001
From: "Fred K. Schott" <fkschott@gmail.com>
Date: Fri, 30 Jul 2021 22:39:15 -0700
Subject: Docs site cleanup (#948)

* add language selector

* docs site cleanup

* review feedback

* code review comments
---
 docs/src/components/DocSidebar/TableOfContents.tsx | 55 ----------------------
 1 file changed, 55 deletions(-)
 delete mode 100644 docs/src/components/DocSidebar/TableOfContents.tsx

(limited to 'docs/src/components/DocSidebar/TableOfContents.tsx')

diff --git a/docs/src/components/DocSidebar/TableOfContents.tsx b/docs/src/components/DocSidebar/TableOfContents.tsx
deleted file mode 100644
index 803b05568..000000000
--- a/docs/src/components/DocSidebar/TableOfContents.tsx
+++ /dev/null
@@ -1,55 +0,0 @@
-import type { FunctionalComponent } from 'preact';
-import { h, Fragment } from 'preact';
-import { useState, useEffect, useRef } from 'preact/hooks';
-
-const TableOfContents: FunctionalComponent<{ headers: any[] }> = ({
-  headers = [],
-}) => {
-  const itemOffsets = useRef([]);
-  const [activeId, setActiveId] = useState<string>(undefined);
-
-  useEffect(() => {
-    const getItemOffsets = () => {
-      const titles = document.querySelectorAll('article :is(h1, h2, h3, h4)');
-      itemOffsets.current = Array.from(titles).map((title) => ({
-        id: title.id,
-        topOffset: title.getBoundingClientRect().top + window.scrollY,
-      }));
-    };
-
-    getItemOffsets();
-    window.addEventListener('resize', getItemOffsets);
-
-    return () => {
-      window.removeEventListener('resize', getItemOffsets);
-    };
-  }, []);
-
-  return (
-    <>
-      <h2 class="heading">On this page</h2>
-      <ul>
-        <li
-          class={`header-link depth-2 ${
-            activeId === 'overview' ? 'active' : ''
-          }`.trim()}
-        >
-          <a href="#overview">Overview</a>
-        </li>
-        {headers
-          .filter(({ depth }) => depth > 1 && depth < 4)
-          .map((header) => (
-            <li
-              class={`header-link depth-${header.depth} ${
-                activeId === header.slug ? 'active' : ''
-              }`.trim()}
-            >
-              <a href={`#${header.slug}`}>{header.text}</a>
-            </li>
-          ))}
-      </ul>
-    </>
-  );
-};
-
-export default TableOfContents;
-- 
cgit v1.2.3

