Skip to content

Commit

Permalink
docs(storybook): motivate to play with mock params
Browse files Browse the repository at this point in the history
  • Loading branch information
bramzijp-code committed Mar 3, 2024
1 parent f7e9ed1 commit 015bf68
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,4 +337,5 @@ Ensure your API type definitions are generated by your backend.
### Demo

[Storybook](https://dynamicmsw.github.io/dynamic-msw)
[Take a look at source code](https://github.com/dynamicmsw/dynamic-msw/tree/main/apps/storybook/src)

[Take a look at source code of the Storybook demo](https://github.com/dynamicmsw/dynamic-msw/tree/main/apps/storybook/src)
12 changes: 12 additions & 0 deletions apps/storybook/src/examples/Product.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,18 @@ const Product = () => {
<Typography variant="subtitle1" color="textSecondary" gutterBottom>
{`Available Stock: ${productDetails.availableStock}`}
</Typography>
<Typography variant="subtitle1" color="textSecondary" gutterBottom>
Using the mock dashboard opened with the button in the bottom right
corner;
<br />
try changing the amount of stock and the "canReview" boolean.
Requires reload to see the changes. Toggling "productExists" to
false will show this product page example does not handle API errors
properly.
</Typography>
<Typography variant="subtitle1" color="textSecondary" gutterBottom>
Try adding a review and reloading the page.
</Typography>
<Typography variant="h6" color="primary" gutterBottom>
Generated by ChatGPT
</Typography>
Expand Down

0 comments on commit 015bf68

Please sign in to comment.