1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

debug output stories, main merged

This commit is contained in:
ClaudiaHolhos 2022-06-16 17:30:32 +03:00
parent e71695fed5
commit 5231f43648
2 changed files with 33 additions and 4 deletions

View File

@ -0,0 +1,27 @@
import React from 'react'
import { ComponentStory, ComponentMeta } from '@storybook/react'
import DebugOutput, { DebugOutputProps } from '@shared/DebugOutput'
export default {
title: 'Component/@shared/DebugOutput',
component: DebugOutput
} as ComponentMeta<typeof DebugOutput>
const Template: ComponentStory<typeof DebugOutput> = (
args: DebugOutputProps
) => <DebugOutput {...args} />
interface Props {
args: DebugOutputProps
}
export const Default: Props = Template.bind({})
Default.args = {
output: <p>Your Debug Data </p>
}
export const WithTitle: Props = Template.bind({})
WithTitle.args = {
title: 'Debug Data',
output: <p>Your Debug Data </p>
}

View File

@ -1,12 +1,14 @@
import React, { ReactElement } from 'react' import React, { ReactElement } from 'react'
export interface DebugOutputProps {
title?: string
output: any
}
export default function DebugOutput({ export default function DebugOutput({
title, title,
output output
}: { }: DebugOutputProps): ReactElement {
title?: string
output: any
}): ReactElement {
return ( return (
<div style={{ marginTop: 'var(--spacer)' }}> <div style={{ marginTop: 'var(--spacer)' }}>
{title && <h5>{title}</h5>} {title && <h5>{title}</h5>}