1
0
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:
Digvijay Pundir (DJ) 2023-04-26 20:43:14 +05:30 committed by GitHub
parent 2943ec3310
commit d428a4895f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,
};