From ab53e97ea0ef47d4558d02d0a9e2f25304e912bb Mon Sep 17 00:00:00 2001 From: Paul Gottschling Date: Mon, 13 May 2024 15:50:04 -0400 Subject: [PATCH] Remove the VarList component We don't use it very often in the docs, and it has failed to render since at least 1fb84dafaa8ac48956eac65a861050b5f838d772. Removing instead of putting in the resources to debug. --- components/Variables/VarList.module.css | 12 ------ components/Variables/VarList.tsx | 51 ------------------------- components/Variables/index.ts | 1 - layouts/DocsPage/components.tsx | 3 +- 4 files changed, 1 insertion(+), 66 deletions(-) delete mode 100644 components/Variables/VarList.module.css delete mode 100644 components/Variables/VarList.tsx diff --git a/components/Variables/VarList.module.css b/components/Variables/VarList.module.css deleted file mode 100644 index c731d07e1c..0000000000 --- a/components/Variables/VarList.module.css +++ /dev/null @@ -1,12 +0,0 @@ -.list { - padding-left: var(--m-1-5); - list-style: none; -} - -.title { - font-size: var(--fs-text-lg); -} - -.text { - margin: 0; -} diff --git a/components/Variables/VarList.tsx b/components/Variables/VarList.tsx deleted file mode 100644 index 6dcff97425..0000000000 --- a/components/Variables/VarList.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import { useContext } from "react"; -import { Var } from "./Var"; -import { VarsContext } from "./context"; -import type { VarsContextProps } from "./context"; -import styles from "./VarList.module.css"; - -export const VarList = () => { - const { fields, globalFields, fieldDescriptions } = - useContext(VarsContext); - const globalFieldsList = Object.keys(globalFields).map((item) => ( -
  • - -
  • - )); - - const pageFields = Object.keys(fields) - .map((field) => (field in globalFields ? undefined : field)) - .filter(Boolean); - - const pageFieldList = pageFields.map((item) => ( -
  • - -
  • - )); - - if (!globalFieldsList.length && !pageFieldList.length) { - return <>; - } - - return ( -
    - {!!globalFieldsList.length && ( - <> -

    Documentation-wide variables

    -
      {globalFieldsList}
    - - )} - {!!pageFieldList.length && ( - <> -

    Page-wide variables

    -
      {pageFieldList}
    - - )} -
    - ); -}; diff --git a/components/Variables/index.ts b/components/Variables/index.ts index ec4f3dbc65..eae026d4af 100644 --- a/components/Variables/index.ts +++ b/components/Variables/index.ts @@ -1,3 +1,2 @@ -export { VarList } from "./VarList"; export { Var } from "./Var"; export { VarsProvider } from "./context"; diff --git a/layouts/DocsPage/components.tsx b/layouts/DocsPage/components.tsx index 3a3987bb26..7253626202 100644 --- a/layouts/DocsPage/components.tsx +++ b/layouts/DocsPage/components.tsx @@ -4,7 +4,7 @@ import Icon from "components/Icon"; import Notice from "components/Notice"; import Snippet from "components/Snippet"; import { Tabs, TabItem } from "components/Tabs"; -import { Var, VarList } from "components/Variables"; +import { Var } from "components/Variables"; import Details from "components/Details"; import { Code, @@ -67,5 +67,4 @@ export const components = { snippet: Snippet, details: Details, var: (props) => , // needed to circumvent props mismatch in types - varlist: VarList, };