From 4c48b5329cd7e103de8d79e245bd2d3570525415 Mon Sep 17 00:00:00 2001 From: jonniebigodes Date: Wed, 18 Oct 2023 16:03:38 +0100 Subject: [PATCH] Docs: Fix links and conditional rendering sections --- docs/configure/features-and-behavior.md | 4 ++-- docs/configure/sidebar-and-urls.md | 2 +- docs/configure/theming.md | 4 ++-- docs/writing-stories/build-pages-with-storybook.md | 4 ++++ 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/configure/features-and-behavior.md b/docs/configure/features-and-behavior.md index d9e720e252c1..0e267371f874 100644 --- a/docs/configure/features-and-behavior.md +++ b/docs/configure/features-and-behavior.md @@ -2,7 +2,7 @@ title: 'Features and behavior' --- -To control the layout of Storybook’s UI you can use `addons.setConfig` in your [`.storybook/manager.js`](./overview.md#configure-story-rendering): +To control the layout of Storybook’s UI you can use `addons.setConfig` in your `.storybook/manager.js`: @@ -56,4 +56,4 @@ You can use URL parameters to configure some of the available features: | **showPanel** | `panel` | `false`, `right`, `bottom` | | **selectedPanel** | `addonPanel` | Any panel ID | | **showTabs** | `tabs` | `true` | -| --- | `instrument` | `false`, `true` | +| --- | `instrument` | `false`, `true` | diff --git a/docs/configure/sidebar-and-urls.md b/docs/configure/sidebar-and-urls.md index 966d928b3fe5..afa793f778af 100644 --- a/docs/configure/sidebar-and-urls.md +++ b/docs/configure/sidebar-and-urls.md @@ -16,7 +16,7 @@ By default, Storybook will treat your top-level nodes as “roots”. Roots are ![Storybook sidebar story roots](./sidebar-roots.png) -If you’d prefer to show top-level nodes as folders rather than roots, you can set the `sidebar.showRoots` option to `false` in [`./storybook/manager.js`](./overview.md#configure-story-rendering): +If you’d prefer to show top-level nodes as folders rather than roots, you can set the `sidebar.showRoots` option to `false` in [`./storybook/manager.js`](./features-and-behavior.md): diff --git a/docs/configure/theming.md b/docs/configure/theming.md index 15828905eaab..b7aebc90fb9e 100644 --- a/docs/configure/theming.md +++ b/docs/configure/theming.md @@ -26,7 +26,7 @@ Make sure you have installed [`@storybook/manager-api`](https://www.npmjs.com/pa -As an example, you can tell Storybook to use the "dark" theme by modifying [`.storybook/manager.js`](./overview.md#configure-story-rendering): +As an example, you can tell Storybook to use the "dark" theme by modifying [`.storybook/manager.js`](./features-and-behavior.md): @@ -44,7 +44,7 @@ When setting a theme, set a complete theme object. The theme is replaced, not co [Storybook Docs](../writing-docs/introduction.md) uses the same theme system as Storybook’s UI but is themed independently from the main UI. -Supposing you have a Storybook theme defined for the main UI in [`.storybook/manager.js`](./overview.md#configure-story-rendering): +Supposing you have a Storybook theme defined for the main UI in [`.storybook/manager.js`](./features-and-behavior.md): diff --git a/docs/writing-stories/build-pages-with-storybook.md b/docs/writing-stories/build-pages-with-storybook.md index 4307a31020f4..07db61971f27 100644 --- a/docs/writing-stories/build-pages-with-storybook.md +++ b/docs/writing-stories/build-pages-with-storybook.md @@ -287,6 +287,8 @@ Another mocking approach is to use libraries that intercept calls at a lower lev Like the [import mocking](##mocking-imports) above, once you have a mock, you’ll still want to set the return value of the mock per-story basis. Do this in Storybook with a [decorator](./decorators.md) that reads the story's [parameters](./parameters.md). + + ### Avoiding mocking dependencies It's possible to avoid mocking the dependencies of connected "container" components entirely by passing them around via props or React context. However, it requires a strict split of the container and presentational component logic. For example, if you have a component responsible for data fetching logic and rendering DOM, it will need to be mocked as previously described. @@ -394,3 +396,5 @@ If you’ve set up `GlobalContainerContext`, you’ll need to set up a decorator /> + +