Skip to content

Commit

Permalink
fix: 🐛 update story parameters to include new args
Browse files Browse the repository at this point in the history
  • Loading branch information
ArrayKnight committed Jul 20, 2020
1 parent a7c28da commit 99ecf97
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 14 deletions.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@
"@storybook/react": "6.0.0-rc.3",
"@types/ajv-keywords": "3.4.0",
"@types/react": "16.9.43",
"@typescript-eslint/eslint-plugin": "3.6.1",
"@typescript-eslint/parser": "3.6.1",
"@typescript-eslint/eslint-plugin": "3.7.0",
"@typescript-eslint/parser": "3.7.0",
"babel-loader": "8.1.0",
"babel-preset-react-app": "9.1.2",
"eslint": "7.4.0",
"eslint": "7.5.0",
"eslint-config-prettier": "6.11.0",
"eslint-config-react": "1.1.7",
"eslint-plugin-prettier": "3.1.4",
Expand All @@ -67,14 +67,14 @@
"npm-run-all": "4.1.5",
"prettier": "2.0.5",
"react-is": "16.13.1",
"rollup": "2.21.0",
"rollup": "2.22.1",
"rollup-plugin-typescript2": "0.27.1",
"semantic-release": "17.1.1",
"typescript": "3.9.6",
"typescript": "3.9.7",
"wait-on": "5.1.0"
},
"dependencies": {
"@apollo/client": "3.0.0",
"@apollo/client": "3.0.2",
"@storybook/addons": "6.0.0-rc.3",
"@storybook/api": "6.0.0-rc.3",
"@storybook/components": "6.0.0-rc.3",
Expand All @@ -85,8 +85,8 @@
"ajv-keywords": "3.5.1",
"axios": "0.19.2",
"change-case": "4.1.1",
"date-fns": "2.14.0",
"downshift": "5.4.6",
"date-fns": "2.15.0",
"downshift": "5.4.7",
"graphql": "15.3.0",
"react": "16.13.1",
"react-json-view": "1.19.1"
Expand Down
12 changes: 9 additions & 3 deletions src/examples/graphql.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { gql } from '@apollo/client'
import { StoryContext } from '@storybook/addons'
import { Args, StoryContext } from '@storybook/addons'
import React, { ReactElement } from 'react'

import { pack, withHeadless } from '../../dist'
Expand Down Expand Up @@ -84,7 +84,10 @@ interface Artworks {
artworks?: ArtworkProps[]
}

export const Artworks = ({ data }: StoryContext): ReactElement | null => {
export const Artworks = (
args: Args,
{ data }: StoryContext,
): ReactElement | null => {
const payload = data as { Artworks?: Artworks } | undefined

if (payload?.Artworks && Array.isArray(payload?.Artworks?.artworks)) {
Expand All @@ -106,7 +109,10 @@ interface Shows {
partner_shows?: ShowProps[]
}

export const Shows = ({ data }: StoryContext): ReactElement | null => {
export const Shows = (
args: Args,
{ data }: StoryContext,
): ReactElement | null => {
const payload = data as { Shows?: Shows } | undefined

if (payload?.Shows && Array.isArray(payload?.Shows?.partner_shows)) {
Expand Down
12 changes: 9 additions & 3 deletions src/examples/restful.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { StoryContext } from '@storybook/addons'
import { Args, StoryContext } from '@storybook/addons'
import React, { ReactElement } from 'react'

import { withHeadless } from '../../dist'
Expand Down Expand Up @@ -33,7 +33,10 @@ export default {
},
}

export const Users = ({ data }: StoryContext): ReactElement | null => {
export const Users = (
args: Args,
{ data }: StoryContext,
): ReactElement | null => {
const payload = data as { Users?: UserProps[] } | undefined

if (Array.isArray(payload?.Users)) {
Expand All @@ -49,7 +52,10 @@ export const Users = ({ data }: StoryContext): ReactElement | null => {
return null
}

export const User = ({ data }: StoryContext): ReactElement | null => {
export const User = (
args: Args,
{ data }: StoryContext,
): ReactElement | null => {
const payload = data as
| { Users?: UserProps[]; User?: UserProps }
| undefined
Expand Down

0 comments on commit 99ecf97

Please sign in to comment.