1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-29 07:16:36 +01:00
metamask-extension/ui/components/app/snaps/snap-ui-renderer/snap-ui-renderer.stories.js

44 lines
1019 B
JavaScript
Raw Normal View History

import React from 'react';
import { Provider } from 'react-redux';
import { panel, text, heading, divider, copyable } from '@metamask/snaps-ui';
import configureStore from '../../../../store/store';
import testData from '../../../../../.storybook/test-data';
import { SnapUIRenderer } from '.';
const store = configureStore(testData);
export default {
title: 'Components/App/SnapUIRenderer',
component: SnapUIRenderer,
decorators: [(story) => <Provider store={store}>{story()}</Provider>],
argTypes: {
data: {
control: 'object',
},
},
};
const DATA = panel([
heading('Foo bar'),
text('Description'),
divider(),
text('More text'),
copyable('Text you can copy'),
]);
export const DefaultStory = (args) => (
<SnapUIRenderer snapId="local:http://localhost:8080/" data={args.data} />
);
DefaultStory.args = {
data: DATA,
};
export const ErrorStory = (args) => (
<SnapUIRenderer snapId="local:http://localhost:8080/" data={args.data} />
);
ErrorStory.args = {
data: 'foo',
};