Skip to content

Commit

Permalink
#549 fix storybook click error
Browse files Browse the repository at this point in the history
  • Loading branch information
Thenlie committed Oct 21, 2023
1 parent 5b8347d commit f4368b1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
12 changes: 11 additions & 1 deletion src/stories/components/ShowCard.stories.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
import type { Meta, StoryObj } from '@storybook/react';
import { ShowCard } from '../../components';
import { MOVIE_DATA } from '../constants';
import { withRouter } from 'storybook-addon-react-router-v6';
import { withRouter, reactRouterParameters } from 'storybook-addon-react-router-v6';

const meta = {
title: 'Components/Show Card',
component: ShowCard,
tags: ['autodocs'],
parameters: {
layout: 'centered',
reactRouter: reactRouterParameters({
location: {
path: '/details/movie/:id',
pathParams: { id: MOVIE_DATA.id },
},
routing: {
path: '/details/movie/:id',
handle: 'details',
},
}),
},
decorators: [withRouter],
} satisfies Meta<typeof ShowCard>;
Expand Down
12 changes: 11 additions & 1 deletion src/stories/components/ShowListCard.stories.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
import { withRouter } from 'storybook-addon-react-router-v6';
import { withRouter, reactRouterParameters } from 'storybook-addon-react-router-v6';
import { ShowListCard } from '../../components';
import { MOVIE_DATA, PROFILE } from '../constants';

Expand All @@ -9,6 +9,16 @@ const meta = {
tags: ['autodocs'],
parameters: {
layout: 'centered',
reactRouter: reactRouterParameters({
location: {
path: '/details/movie/:id',
pathParams: { id: MOVIE_DATA.id },
},
routing: {
path: '/details/movie/:id',
handle: 'details',
},
}),
},
decorators: [withRouter],
} satisfies Meta<typeof ShowListCard>;
Expand Down
12 changes: 11 additions & 1 deletion src/stories/components/ShowPoster.stories.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
import { withRouter } from 'storybook-addon-react-router-v6';
import { withRouter, reactRouterParameters } from 'storybook-addon-react-router-v6';
import { ShowPoster } from '../../components';
import { MOVIE_DATA } from '../constants';
import { ProfileActions } from '../../types';
Expand All @@ -22,6 +22,16 @@ const meta = {
tags: ['autodocs'],
parameters: {
layout: 'centered',
reactRouter: reactRouterParameters({
location: {
path: '/details/movie/:id',
pathParams: { id: MOVIE_DATA.id },
},
routing: {
path: '/details/movie/:id',
handle: 'details',
},
}),
},
decorators: [withRouter],
} satisfies Meta<typeof ShowPoster>;
Expand Down

0 comments on commit f4368b1

Please sign in to comment.