mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Update knobs to control: MetamaskTemplateRenderer (#18677)
Co-authored-by: Brad Decker <bhdecker84@gmail.com>
This commit is contained in:
parent
2943ec3310
commit
d428a4895f
@ -1,5 +1,4 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { object } from '@storybook/addon-knobs';
|
|
||||||
import {
|
import {
|
||||||
TextColor,
|
TextColor,
|
||||||
TypographyVariant,
|
TypographyVariant,
|
||||||
@ -8,6 +7,12 @@ import MetaMaskTemplateRenderer from '.';
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: 'Components/App/MetamaskTemplateRenderer',
|
title: 'Components/App/MetamaskTemplateRenderer',
|
||||||
|
component: MetaMaskTemplateRenderer,
|
||||||
|
argTypes: {
|
||||||
|
sections: {
|
||||||
|
control: 'object',
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const SECTIONS = {
|
const SECTIONS = {
|
||||||
@ -85,25 +90,12 @@ const SECTIONS = {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const DefaultStory = () => (
|
export const DefaultStory = (args) => (
|
||||||
<MetaMaskTemplateRenderer sections={object('sections', SECTIONS)} />
|
<MetaMaskTemplateRenderer sections={args.sections} />
|
||||||
);
|
);
|
||||||
|
|
||||||
DefaultStory.storyName = 'Default';
|
DefaultStory.storyName = 'Default';
|
||||||
|
|
||||||
export const WithInvalidElement = () => (
|
DefaultStory.args = {
|
||||||
<MetaMaskTemplateRenderer
|
sections: SECTIONS,
|
||||||
sections={object('sections', [
|
};
|
||||||
{
|
|
||||||
...SECTIONS,
|
|
||||||
key: 'safe-tree',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
element: 'Unsafe',
|
|
||||||
key: 'unsafe-tree',
|
|
||||||
children:
|
|
||||||
'I should be displayed, but I wont be due to unsafe component',
|
|
||||||
},
|
|
||||||
])}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
|
Loading…
Reference in New Issue
Block a user