1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 18:41:38 +01:00
metamask-extension/ui/components/multichain/token-list-item/token-list-item.stories.js

89 lines
1.7 KiB
JavaScript
Raw Normal View History

2023-03-23 11:08:33 +01:00
import React from 'react';
import { Provider } from 'react-redux';
import testData from '../../../../.storybook/test-data';
import configureStore from '../../../store/store';
import { TokenListItem } from '.';
2023-03-23 11:08:33 +01:00
export default {
title: 'Components/Multichain/MultichainTokenListItem',
component: TokenListItem,
2023-03-23 11:08:33 +01:00
argTypes: {
tokenSymbol: {
control: 'text',
},
tokenImage: {
control: 'text',
},
primary: {
control: 'text',
},
secondary: {
control: 'text',
},
title: {
control: 'text',
},
onClick: {
action: 'onClick',
},
},
args: {
secondary: '$9.80 USD',
primary: '88.0068',
tokenImage: './images/eth_logo.png',
2023-03-23 11:08:33 +01:00
tokenSymbol: 'ETH',
title: 'Ethereum',
},
};
const customNetworkData = {
...testData,
metamask: {
...testData.metamask,
providerConfig: {
chainId: '0x1',
},
},
2023-03-23 11:08:33 +01:00
};
const customNetworkStore = configureStore(customNetworkData);
const Template = (args) => {
return <TokenListItem {...args} />;
2023-03-23 11:08:33 +01:00
};
export const DefaultStory = Template.bind({});
DefaultStory.decorators = [
(Story) => (
<Provider store={customNetworkStore}>
<Story />
</Provider>
),
];
2023-03-23 11:08:33 +01:00
export const ChaosStory = (args) => (
<div
style={{ width: '336px', border: '1px solid var(--color-border-muted)' }}
>
<TokenListItem {...args} />
2023-03-23 11:08:33 +01:00
</div>
);
ChaosStory.decorators = [
(Story) => (
<Provider store={customNetworkStore}>
<Story />
</Provider>
),
];
2023-03-23 11:08:33 +01:00
ChaosStory.args = {
title: 'Really long, long name',
secondary: '$94556756776.80 USD',
primary: '34449765768526.00',
};
export const NoImagesStory = Template.bind({});
NoImagesStory.args = {
tokenImage: '',
};