mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-27 12:56:01 +01:00
c75d2dce55
* Start implementation of Snaps UI Renderer * Add snap name and fix some design issues * Fix lint * Add some types * More fixes * Actually install snaps-ui * Use JS instead of TS * Remove unused deps * Remove dep * Update LavaMoat policies * Fix style lint * Add story * Small tweaks after rebase * Remove spacer and add test * Fix lint * Remove console.log * Add error message * Remove edge-case that doesnt exist anymore * Update yarn.lock * Update policy
35 lines
922 B
JavaScript
35 lines
922 B
JavaScript
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';
|
|
import { SnapUIRenderer } from '.';
|
|
|
|
const store = configureStore(testData);
|
|
|
|
export default {
|
|
title: 'Components/App/SnapUIRenderer',
|
|
id: __filename,
|
|
decorators: [(story) => <Provider store={store}>{story()}</Provider>],
|
|
};
|
|
|
|
const DATA = panel([
|
|
heading('Foo bar'),
|
|
text('Description'),
|
|
divider(),
|
|
text('More text'),
|
|
copyable('Text you can copy'),
|
|
]);
|
|
|
|
export const DefaultStory = () => (
|
|
<SnapUIRenderer
|
|
snapId="local:http://localhost:8080/"
|
|
data={object('data', DATA)}
|
|
/>
|
|
);
|
|
|
|
export const ErrorStory = () => (
|
|
<SnapUIRenderer snapId="local:http://localhost:8080/" data="foo" />
|
|
);
|