mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Mįgrate truncated definition list stories from addon knobs to use controls. (#13628)
This commit is contained in:
parent
e082334da8
commit
ef3199ebd1
@ -1,11 +1,12 @@
|
||||
import React from 'react';
|
||||
import { object, text } from '@storybook/addon-knobs';
|
||||
|
||||
import TruncatedDefinitionList from './truncated-definition-list';
|
||||
|
||||
export default {
|
||||
title: 'Components/UI/TruncatedDefinitionList',
|
||||
id: __filename,
|
||||
argTypes: {
|
||||
title: { control: 'text', defaultValue: 'Basic definitions' },
|
||||
},
|
||||
};
|
||||
|
||||
const basic = {
|
||||
@ -30,21 +31,34 @@ const tooltips = {
|
||||
Ticker: 'The currency symbol of the primary currency for this network',
|
||||
};
|
||||
|
||||
export const DefaultStory = () => (
|
||||
<TruncatedDefinitionList
|
||||
dictionary={object('dictionary', basic)}
|
||||
title={text('title', 'Basic definitions')}
|
||||
prefaceKeys={object('prefaceKeys', ['term', 'definition'])}
|
||||
/>
|
||||
);
|
||||
export const DefaultStory = (args) => <TruncatedDefinitionList {...args} />;
|
||||
|
||||
DefaultStory.argTypes = {
|
||||
dictionary: {
|
||||
control: 'object',
|
||||
defaultValue: basic,
|
||||
},
|
||||
prefaceKeys: {
|
||||
control: 'object',
|
||||
defaultValue: ['term', 'definition'],
|
||||
},
|
||||
};
|
||||
|
||||
DefaultStory.storyName = 'Default';
|
||||
|
||||
export const WithTooltips = () => (
|
||||
<TruncatedDefinitionList
|
||||
dictionary={object('dictionary', advanced)}
|
||||
title={text('title', 'Network Details')}
|
||||
tooltips={object('tooltips', tooltips)}
|
||||
prefaceKeys={object('prefaceKeys', ['Chain ID'])}
|
||||
/>
|
||||
);
|
||||
export const WithTooltips = (args) => <TruncatedDefinitionList {...args} />;
|
||||
|
||||
WithTooltips.argTypes = {
|
||||
dictionary: {
|
||||
control: 'object',
|
||||
defaultValue: advanced,
|
||||
},
|
||||
tooltips: {
|
||||
control: 'object',
|
||||
defaultValue: tooltips,
|
||||
},
|
||||
prefaceKeys: {
|
||||
control: 'array',
|
||||
defaultValue: ['Chain ID'],
|
||||
},
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user