Skip to content

Commit

Permalink
Remove the VarList component (#464)
Browse files Browse the repository at this point in the history
We don't use it very often in the docs, and it has failed to render
since at least 1fb84da. Removing
instead of putting in the resources to debug.
  • Loading branch information
ptgott authored May 15, 2024
1 parent b9734c8 commit 3866bcd
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 84 deletions.
12 changes: 0 additions & 12 deletions components/Variables/VarList.module.css

This file was deleted.

51 changes: 0 additions & 51 deletions components/Variables/VarList.tsx

This file was deleted.

1 change: 0 additions & 1 deletion components/Variables/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export { VarList } from "./VarList";
export { Var } from "./Var";
export { VarsProvider } from "./context";
17 changes: 0 additions & 17 deletions docs-contributors/ui-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,6 @@ between browser sessions.

#### Var component properties

The `description` field is used in the `VarList` component, which we explain in
the next section. You only need to specify the `description` once.

By default, the `Var` component displays its `name` until the user assigns a
value to it. To configure the component to display an initial value beside its
name, set the `initial` field:
Expand All @@ -163,20 +160,6 @@ name, set the `initial` field:
You should only set an `initial` field for a single occurrence of a `Var` with a
particular name. Otherwise, `Var`s will overwrite one another's initial values.

### The VarList component

To provide a key for all of the global and page-local variables the docs have
defined, use the `VarList` component:

```markdown
<Details title="Page variables" opened>
<VarList/>
</Details>
```

The description we added to the `proxy` variable appears here. Since the `user`
variable does not have a description, the `VarList` shows its name instead.

## Notices

If you want to add notice like the one above to the page, use this syntax:
Expand Down
3 changes: 1 addition & 2 deletions layouts/DocsPage/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -67,5 +67,4 @@ export const components = {
snippet: Snippet,
details: Details,
var: (props) => <Var {...props} />, // needed to circumvent props mismatch in types
varlist: VarList,
};
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@
"storybook:test-local": "yarn build-storybook --quiet && npx concurrently -k -s first -n \"SB,TEST\" -c \"magenta,blue\" \"npx http-server storybook-static --port 6006 --silent\" \"yarn test-storybook\""
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": ["eslint", "prettier --check"],
"*.{js,jsx,ts,tsx}": [
"eslint",
"prettier --check"
],
"*.{json}": "prettier --check"
},
"simple-git-hooks": {
Expand Down

0 comments on commit 3866bcd

Please sign in to comment.