Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update knobs to control: MetamaskTemplateRenderer #18677

Merged
merged 3 commits into from
Apr 26, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import React from 'react';
import { object } from '@storybook/addon-knobs';
import {
TextColor,
TypographyVariant,
Expand All @@ -8,6 +8,12 @@ import MetaMaskTemplateRenderer from '.';

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

const SECTIONS = {
Expand Down Expand Up @@ -85,25 +91,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',
},
])}
/>
);
Comment on lines -94 to -109
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggested to @dj-pundir to remove this story as it was display an error intentionally but I don't think it adds much value in storybook

DefaultStory.args = {
sections: SECTIONS
};