Skip to content

Commit

Permalink
Docs: Minor updates to links and navigation issue (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonniebigodes authored Oct 30, 2023
1 parent e9f15ab commit 0ff898a
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions packages/docs/src/guides/introduction.mdx
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import { Meta } from '@storybook/addon-docs'
import LinkTo from '@storybook/addon-links/react'
import { Meta } from "@storybook/addon-docs";
import LinkTo from "@storybook/addon-links/react";

<Meta title="Guides/Introduction" />

<header className="introduction-header">
<img src="https://user-images.githubusercontent.com/1671563/144888802-84346d8f-77c9-4377-98c7-4b0364797978.png" width="200" height="172" />
<img
src="https://user-images.githubusercontent.com/1671563/144888802-84346d8f-77c9-4377-98c7-4b0364797978.png"
width="200"
height="172"
/>
<h1>MSW Storybook Addon</h1>
</header>

With Storybook, we can test our app components in isolation and later integrate in the application. With the trend of fetching data inside components, adding stories for complex components and pages becomes difficult. With `msw-storybook-addon`, you can easily mock your APIs, making that process much simpler!

## Get started

Refer to the <LinkTo className="introduction-demo-link" kind="Guides/Getting Started" story="page">Getting started</LinkTo> page for installation and usage.
Refer to the <LinkTo className="introduction-demo-link" kind="Guides/Getting Started" story="docs">Getting started</LinkTo> page for installation and usage.

## Features

Expand All @@ -25,14 +29,14 @@ Refer to the <LinkTo className="introduction-demo-link" kind="Guides/Getting Sta
`msw-storybook-addon` integrates well with browser fetch & libraries like React Query and Urql. Find the demos in the sidebar on the left.
The code for each example is available on [GitHub](https://github.com/mswjs/msw-storybook-addon/tree/master/packages/docs/src/demos).

- API call with Fetch: <LinkTo className="introduction-demo-link" kind="Demos/Fetch" story="mocked-success">Story</LinkTo> | [Source](https://github.com/mswjs/msw-storybook-addon/blob/master/packages/docs/src/demos/fetch/App.stories.js)
- API call with React Query: <LinkTo className="introduction-demo-link" kind="Demos/React Query" story="mocked-success">Story</LinkTo> | [Source](https://github.com/mswjs/msw-storybook-addon/blob/master/packages/docs/src/demos/react-query/App.stories.js)
- API call with Urql: <LinkTo className="introduction-demo-link" kind="Demos/Urql" story="mocked-success">Story</LinkTo> | [Source](https://github.com/mswjs/msw-storybook-addon/blob/master/packages/docs/src/demos/urql/App.stories.js)
- API call with Fetch: <LinkTo className="introduction-demo-link" kind="Demos/Fetch" story="mocked-success">Story</LinkTo> | [Source](https://github.com/mswjs/msw-storybook-addon/blob/main/packages/docs/src/demos/fetch/App.stories.jsx)
- API call with React Query: <LinkTo className="introduction-demo-link" kind="Demos/React Query" story="mocked-success">Story</LinkTo> | [Source](https://github.com/mswjs/msw-storybook-addon/blob/main/packages/docs/src/demos/react-query/App.stories.jsx)
- API call with Urql: <LinkTo className="introduction-demo-link" kind="Demos/Urql" story="mocked-success">Story</LinkTo> | [Source](https://github.com/mswjs/msw-storybook-addon/blob/main/packages/docs/src/demos/urql/App.stories.jsx)

### Render pages in Storybook

The following demo uses React Router for rendering various page components & React Query for fetching data in these components. It's upto you to decide how much of the app you want in Storybook.
The following demo uses React Router for rendering various page components & React Query for fetching data in these components. It's up to you to decide how much of the app you want in Storybook.

- Whole App <LinkTo className="introduction-demo-link" kind="Demos/React Router + RQ" story="mocked-app">Story</LinkTo> | [Source](https://github.com/mswjs/msw-storybook-addon/blob/master/packages/docs/src/demos/react-router-react-query/App.stories.js)
- Subsection of App (like /films/1 route) <LinkTo className="introduction-demo-link" kind="Demos/React Router + RQ" story="mocked-film-subsection">Story</LinkTo> | [Source](https://github.com/mswjs/msw-storybook-addon/blob/master/packages/docs/src/demos/react-router-react-query/App.stories.js)
- Isolated Page components (like Film.js component) <LinkTo className="introduction-demo-link" kind="Demos/React Router + RQ/Page Stories/Film" story="mocked-success">Story</LinkTo> | [Source](https://github.com/mswjs/msw-storybook-addon/blob/master/packages/docs/src/demos/react-router-react-query/pages/film/Film.stories.js)
- Whole App <LinkTo className="introduction-demo-link" kind="Demos/React Router + RQ" story="mocked-app">Story</LinkTo> | [Source](https://github.com/mswjs/msw-storybook-addon/blob/main/packages/docs/src/demos/react-router-react-query/App.stories.jsx)
- Subsection of App (like /films/1 route) <LinkTo className="introduction-demo-link" kind="Demos/React Router + RQ" story="mocked-film-subsection">Story</LinkTo> | [Source](https://github.com/mswjs/msw-storybook-addon/blob/main/packages/docs/src/demos/react-router-react-query/App.stories.jsx)
- Isolated Page components (like Film.js component) <LinkTo className="introduction-demo-link" kind="Demos/React Router + RQ/Page Stories/Film" story="mocked-success">Story</LinkTo> | [Source](https://github.com/mswjs/msw-storybook-addon/blob/main/packages/docs/src/demos/react-router-react-query/pages/film/Film.stories.jsx)

1 comment on commit 0ff898a

@vercel
Copy link

@vercel vercel bot commented on 0ff898a Oct 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

msw-storybook-addon – ./

msw-storybook-addon-mswjs.vercel.app
msw-sb.vercel.app
msw-storybook-addon-git-main-mswjs.vercel.app

Please sign in to comment.