From 826ac55c32c60f0a89afdb53e1ec2bbb43637aea Mon Sep 17 00:00:00 2001 From: dswilson4 <33137497+dswilson4@users.noreply.github.com> Date: Mon, 10 Apr 2023 01:07:07 -0700 Subject: [PATCH] initial changes to support controls over knobs in storybook (#18502) * initial changes to support controls over knobs in storybook * fix linting issue --- .../snap-ui-renderer.stories.js | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/ui/components/app/flask/snap-ui-renderer/snap-ui-renderer.stories.js b/ui/components/app/flask/snap-ui-renderer/snap-ui-renderer.stories.js index 06c80a19a..d2fdcd7d9 100644 --- a/ui/components/app/flask/snap-ui-renderer/snap-ui-renderer.stories.js +++ b/ui/components/app/flask/snap-ui-renderer/snap-ui-renderer.stories.js @@ -1,6 +1,5 @@ import React from 'react'; import { Provider } from 'react-redux'; -import { object } from '@storybook/addon-knobs'; import { panel, text, heading, divider, copyable } from '@metamask/snaps-ui'; import configureStore from '../../../../store/store'; import testData from '../../../../../.storybook/test-data'; @@ -10,8 +9,13 @@ const store = configureStore(testData); export default { title: 'Components/App/SnapUIRenderer', - + component: SnapUIRenderer, decorators: [(story) => {story()}], + argTypes: { + data: { + control: 'object', + }, + }, }; const DATA = panel([ @@ -22,13 +26,18 @@ const DATA = panel([ copyable('Text you can copy'), ]); -export const DefaultStory = () => ( - +export const DefaultStory = (args) => ( + ); -export const ErrorStory = () => ( - +DefaultStory.args = { + data: DATA, +}; + +export const ErrorStory = (args) => ( + ); + +ErrorStory.args = { + data: 'foo', +};