Skip to content

Commit

Permalink
refactor: migrate storybookv5 to v8
Browse files Browse the repository at this point in the history
  • Loading branch information
ShriD2003 committed Aug 21, 2024
1 parent f2dcd4e commit ee61f79
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 24 deletions.
13 changes: 13 additions & 0 deletions app/components/Clickable/stories/clickable.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';
import { Meta, Story } from '@storybook/react';
import { Clickable } from '../index';

export default {
title: 'Clickable',
component: Clickable
};

const ClickableTemplate = (args) => <Clickable {...args} />;

export const ClickableStoryComponent = ClickableTemplate.bind({});
ClickableStoryComponent.args = {};
19 changes: 19 additions & 0 deletions app/components/Header/stories/Header.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';
import { MemoryRouter } from 'react-router-dom';
import Header from '../index';

export default {
title: 'Header',
component: Header
};

const HeaderTemplate = (args) => (
<MemoryRouter>
<Header {...args} />
</MemoryRouter>
);

export const HeaderStoryComponent = HeaderTemplate.bind({});
HeaderStoryComponent.args = {
id: 'Header'
};
47 changes: 23 additions & 24 deletions app/components/LaunchList/stories/LaunchList.stories.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
/**
*
* Stories for LaunchList
*
* @see https://github.com/storybookjs/storybook
*
*/

import React from 'react';
import { storiesOf } from '@storybook/react';
import { LaunchList } from '../index';
import LaunchList from '../index';

const loading = false;
const launchData = {
launches: [
{
id: '1',
launchDateUtc: '2014-01-06T14:06:00',
missionName: 'Thaicom 6',
links: {
wikipedia: 'https://en.wikipedia.org/wiki/Thaicom_6',
flickrImages: ['https://farm9.staticflickr.com/8617/16789019815_f99a165dc5_o.jpg']
}
}
]
export default {
title: 'LaunchList',
component: LaunchList
};

storiesOf('LaunchList').add('simple', () => <LaunchList launchData={launchData} loading={loading} />);
const LaunchListTemplate = (args) => <LaunchList {...args} />;

export const LaunchListStoryComponent = LaunchListTemplate.bind({});
LaunchListStoryComponent.args = {
launchData: {
launches: [
{
id: '1',
launchDateUtc: '2014-01-06T14:06:00',
missionName: 'Thaicom 6',
links: {
wikipedia: 'https://en.wikipedia.org/wiki/Thaicom_6',
flickrImages: ['https://farm9.staticflickr.com/8617/16789019815_f99a165dc5_o.jpg']
}
}
]
},
loading: false
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@
"rimraf": "2.6.3",
"shelljs": "0.8.3",
"storybook": "^8.2.9",
"storybook-addon-intl": "^4.0.0",
"storybook-router": "^0.3.4",
"style-loader": "2.0.0",
"stylelint": "10.0.1",
Expand Down

0 comments on commit ee61f79

Please sign in to comment.