|
|
@ -1,11 +1,12 @@ |
|
|
|
import React from 'react'; |
|
|
|
import React from 'react'; |
|
|
|
import { object, text } from '@storybook/addon-knobs'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import TruncatedDefinitionList from './truncated-definition-list'; |
|
|
|
import TruncatedDefinitionList from './truncated-definition-list'; |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
|
title: 'Components/UI/TruncatedDefinitionList', |
|
|
|
title: 'Components/UI/TruncatedDefinitionList', |
|
|
|
id: __filename, |
|
|
|
id: __filename, |
|
|
|
|
|
|
|
argTypes: { |
|
|
|
|
|
|
|
title: { control: 'text', defaultValue: 'Basic definitions' }, |
|
|
|
|
|
|
|
}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const basic = { |
|
|
|
const basic = { |
|
|
@ -30,21 +31,34 @@ const tooltips = { |
|
|
|
Ticker: 'The currency symbol of the primary currency for this network', |
|
|
|
Ticker: 'The currency symbol of the primary currency for this network', |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export const DefaultStory = () => ( |
|
|
|
export const DefaultStory = (args) => <TruncatedDefinitionList {...args} />; |
|
|
|
<TruncatedDefinitionList |
|
|
|
|
|
|
|
dictionary={object('dictionary', basic)} |
|
|
|
DefaultStory.argTypes = { |
|
|
|
title={text('title', 'Basic definitions')} |
|
|
|
dictionary: { |
|
|
|
prefaceKeys={object('prefaceKeys', ['term', 'definition'])} |
|
|
|
control: 'object', |
|
|
|
/> |
|
|
|
defaultValue: basic, |
|
|
|
); |
|
|
|
}, |
|
|
|
|
|
|
|
prefaceKeys: { |
|
|
|
|
|
|
|
control: 'object', |
|
|
|
|
|
|
|
defaultValue: ['term', 'definition'], |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
DefaultStory.storyName = 'Default'; |
|
|
|
DefaultStory.storyName = 'Default'; |
|
|
|
|
|
|
|
|
|
|
|
export const WithTooltips = () => ( |
|
|
|
export const WithTooltips = (args) => <TruncatedDefinitionList {...args} />; |
|
|
|
<TruncatedDefinitionList |
|
|
|
|
|
|
|
dictionary={object('dictionary', advanced)} |
|
|
|
WithTooltips.argTypes = { |
|
|
|
title={text('title', 'Network Details')} |
|
|
|
dictionary: { |
|
|
|
tooltips={object('tooltips', tooltips)} |
|
|
|
control: 'object', |
|
|
|
prefaceKeys={object('prefaceKeys', ['Chain ID'])} |
|
|
|
defaultValue: advanced, |
|
|
|
/> |
|
|
|
}, |
|
|
|
); |
|
|
|
tooltips: { |
|
|
|
|
|
|
|
control: 'object', |
|
|
|
|
|
|
|
defaultValue: tooltips, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
prefaceKeys: { |
|
|
|
|
|
|
|
control: 'array', |
|
|
|
|
|
|
|
defaultValue: ['Chain ID'], |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}; |
|
|
|