From 7e16f500cb7bc0cfd8bafbf6bb1555704f771231 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Fri, 29 Apr 2022 12:13:34 +0200
Subject: chore: remove old pages, components, helpers and types

Since I'm using new components, I will also rewrite the GraphQL queries
so it is easier to start from scratch.
---
 src/components/Widgets/ToC/ToC.tsx | 55 --------------------------------------
 1 file changed, 55 deletions(-)
 delete mode 100644 src/components/Widgets/ToC/ToC.tsx

(limited to 'src/components/Widgets/ToC/ToC.tsx')

diff --git a/src/components/Widgets/ToC/ToC.tsx b/src/components/Widgets/ToC/ToC.tsx
deleted file mode 100644
index 3f759db..0000000
--- a/src/components/Widgets/ToC/ToC.tsx
+++ /dev/null
@@ -1,55 +0,0 @@
-import { ExpandableWidget, OrderedList } from '@components/WidgetParts';
-import { Heading } from '@ts/types/app';
-import useHeadingsTree from '@utils/hooks/useHeadingsTree';
-import { FormattedMessage, useIntl } from 'react-intl';
-
-const ToC = () => {
-  const intl = useIntl();
-  const headingsTree = useHeadingsTree('article');
-  const title = intl.formatMessage({
-    defaultMessage: 'Table of contents',
-    description: 'ToC: widget title',
-    id: 'Zg4L7U',
-  });
-
-  const getItems = (headings: Heading[]) => {
-    return headings.map((heading) => {
-      return (
-        <li key={heading.id}>
-          <a href={`#${heading.id}`}>
-            <FormattedMessage
-              defaultMessage="<a11y>Jump to </a11y>{title}"
-              description="ToC: link"
-              id="GgIWnN"
-              values={{
-                title: heading.title,
-                a11y: (chunks: string) => (
-                  <span className="screen-reader-text">{chunks}</span>
-                ),
-              }}
-            />
-          </a>
-          {heading.children.length > 0 && (
-            <OrderedList items={getItems(heading.children)} />
-          )}
-        </li>
-      );
-    });
-  };
-
-  return (
-    <ExpandableWidget title={title} kind="toc" expand={true} withBorders={true}>
-      <noscript>
-        {intl.formatMessage({
-          defaultMessage:
-            'Javascript is required to use the table of contents.',
-          description: 'ToC: noscript tag',
-          id: 'RZzx/4',
-        })}
-      </noscript>
-      <OrderedList items={getItems(headingsTree)} />
-    </ExpandableWidget>
-  );
-};
-
-export default ToC;
-- 
cgit v1.2.3

