2021-02-04 19:15:23 +01:00
|
|
|
import React from 'react';
|
|
|
|
import { object } from '@storybook/addon-knobs';
|
|
|
|
import { COLORS, TYPOGRAPHY } from '../../../helpers/constants/design-system';
|
|
|
|
import MetaMaskTemplateRenderer from '.';
|
2021-02-02 19:14:04 +01:00
|
|
|
|
|
|
|
export default {
|
|
|
|
title: 'MetaMask Template Renderer',
|
2021-09-15 20:55:48 +02:00
|
|
|
id: __filename,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2021-02-02 19:14:04 +01:00
|
|
|
|
|
|
|
const SECTIONS = {
|
|
|
|
element: 'Box',
|
|
|
|
props: {
|
|
|
|
margin: 4,
|
|
|
|
padding: 8,
|
|
|
|
borderColor: COLORS.PRIMARY1,
|
|
|
|
borderWidth: 2,
|
|
|
|
},
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
element: 'Typography',
|
|
|
|
key: 'A Test String',
|
|
|
|
children: 'A Test String',
|
|
|
|
props: {
|
|
|
|
color: COLORS.UI3,
|
|
|
|
variant: TYPOGRAPHY.H2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
element: 'Typography',
|
|
|
|
key: 'Some more text',
|
|
|
|
children: 'Some more text as a paragraph',
|
|
|
|
props: {
|
|
|
|
color: COLORS.UI4,
|
|
|
|
variant: TYPOGRAPHY.Paragraph,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
element: 'TruncatedDefinitionList',
|
|
|
|
key: 'TDL',
|
|
|
|
props: {
|
|
|
|
dictionary: {
|
|
|
|
term:
|
|
|
|
'a word or phrase used to describe a thing or to express a concept, especially in a particular kind of language or branch of study.',
|
|
|
|
definition:
|
|
|
|
'a statement of the exact meaning of a word, especially in a dictionary.',
|
|
|
|
dl: 'HTML tag denoting a definition list',
|
|
|
|
dt: 'HTML tag denoting a definition list term',
|
|
|
|
dd: 'HTML tag denoting a definition list definition',
|
|
|
|
},
|
|
|
|
title: 'Full list',
|
|
|
|
prefaceKeys: ['term', 'definition'],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
element: 'Box',
|
|
|
|
key: 'ActionsBox',
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
element: 'Button',
|
|
|
|
children: 'Cancel',
|
|
|
|
key: 'cancel-button',
|
|
|
|
props: {
|
|
|
|
type: 'outlined',
|
|
|
|
style: {
|
|
|
|
width: '45%',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
element: 'Button',
|
|
|
|
children: 'OK',
|
|
|
|
key: 'ok-button',
|
|
|
|
props: {
|
|
|
|
type: 'primary',
|
|
|
|
style: {
|
|
|
|
width: '45%',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
props: { justifyContent: 'space-between', padding: [0, 4] },
|
|
|
|
},
|
|
|
|
],
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2021-02-02 19:14:04 +01:00
|
|
|
export const metaMaskTemplateRenderer = () => (
|
|
|
|
<MetaMaskTemplateRenderer sections={object('sections', SECTIONS)} />
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
2021-02-02 19:14:04 +01:00
|
|
|
|
|
|
|
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',
|
|
|
|
},
|
|
|
|
])}
|
|
|
|
/>
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|