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

networkId fix, FileIcon stories added

This commit is contained in:
ClaudiaHolhos 2022-05-30 17:26:00 +03:00
parent 166709e314
commit ed4ba03e1f
3 changed files with 38 additions and 7 deletions

View File

@ -17,7 +17,7 @@ interface Props {
export const Default: Props = Template.bind({})
Default.args = {
networkId: 1008,
networkId: 1287,
path: 'https://example.com',
children: <p>Explorer link</p>
}

View File

@ -0,0 +1,29 @@
import React from 'react'
import { ComponentStory, ComponentMeta } from '@storybook/react'
import FileIcon, { FileIconProps } from '@shared/FileIcon'
import { FileMetadata } from '@oceanprotocol/lib'
export default {
title: 'Component/@shared/FileIcon',
component: FileIcon
} as ComponentMeta<typeof FileIcon>
const Template: ComponentStory<typeof FileIcon> = (args: FileIconProps) => (
<FileIcon {...args} />
)
interface Props {
args: FileIconProps
}
const file = {
contentLength: '0',
contentType: 'text/html',
index: 0,
valid: true
}
export const Default: Props = Template.bind({})
Default.args = {
file: file as FileMetadata
}

View File

@ -8,6 +8,13 @@ import { FileMetadata } from '@oceanprotocol/lib'
const cx = classNames.bind(styles)
export interface FileIconProps {
file: FileMetadata
className?: string
small?: boolean
isLoading?: boolean
}
function LoaderArea() {
return (
<div className={styles.loaderWrap}>
@ -21,12 +28,7 @@ export default function FileIcon({
className,
small,
isLoading
}: {
file: FileMetadata
className?: string
small?: boolean
isLoading?: boolean
}): ReactElement {
}: FileIconProps): ReactElement {
const styleClasses = cx({
file: true,
small,