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 { object } from '@storybook/addon-knobs';
|
||||
import {
|
||||
TextColor,
|
||||
TypographyVariant,
|
||||
@ -8,6 +7,12 @@ import MetaMaskTemplateRenderer from '.';
|
||||
|
||||
export default {
|
||||
title: 'Components/App/MetamaskTemplateRenderer',
|
||||
component: MetaMaskTemplateRenderer,
|
||||
argTypes: {
|
||||
sections: {
|
||||
control: 'object',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const SECTIONS = {
|
||||
@ -85,25 +90,12 @@ const SECTIONS = {
|
||||
],
|
||||
};
|
||||
|
||||
export const DefaultStory = () => (
|
||||
<MetaMaskTemplateRenderer sections={object('sections', SECTIONS)} />
|
||||
export const DefaultStory = (args) => (
|
||||
<MetaMaskTemplateRenderer sections={args.sections} />
|
||||
);
|
||||
|
||||
DefaultStory.storyName = 'Default';
|
||||
|
||||
export const WithInvalidElement = () => (
|
||||
<MetaMaskTemplateRenderer
|
||||
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',
|
||||
},
|
||||
])}
|
||||
/>
|
||||
);
|
||||
DefaultStory.args = {
|
||||
sections: SECTIONS,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user