Skip to content

Commit

Permalink
Update knobs to control: MetamaskTemplateRenderer (#18677)
Browse files Browse the repository at this point in the history
Co-authored-by: Brad Decker <[email protected]>
  • Loading branch information
dj-pundir and brad-decker authored Apr 26, 2023
1 parent 2943ec3 commit d428a48
Showing 1 changed file with 11 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import { object } from '@storybook/addon-knobs';
import {
TextColor,
TypographyVariant,
Expand All @@ -8,6 +7,12 @@ import MetaMaskTemplateRenderer from '.';

export default {
title: 'Components/App/MetamaskTemplateRenderer',
component: MetaMaskTemplateRenderer,
argTypes: {
sections: {
control: 'object',
},
},
};

const SECTIONS = {
Expand Down Expand Up @@ -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,
};

0 comments on commit d428a48

Please sign in to comment.