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:
parent
166709e314
commit
ed4ba03e1f
@ -17,7 +17,7 @@ interface Props {
|
|||||||
|
|
||||||
export const Default: Props = Template.bind({})
|
export const Default: Props = Template.bind({})
|
||||||
Default.args = {
|
Default.args = {
|
||||||
networkId: 1008,
|
networkId: 1287,
|
||||||
path: 'https://example.com',
|
path: 'https://example.com',
|
||||||
children: <p>Explorer link</p>
|
children: <p>Explorer link</p>
|
||||||
}
|
}
|
||||||
|
29
src/components/@shared/FileIcon/index.stories.tsx
Normal file
29
src/components/@shared/FileIcon/index.stories.tsx
Normal 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
|
||||||
|
}
|
@ -8,6 +8,13 @@ import { FileMetadata } from '@oceanprotocol/lib'
|
|||||||
|
|
||||||
const cx = classNames.bind(styles)
|
const cx = classNames.bind(styles)
|
||||||
|
|
||||||
|
export interface FileIconProps {
|
||||||
|
file: FileMetadata
|
||||||
|
className?: string
|
||||||
|
small?: boolean
|
||||||
|
isLoading?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
function LoaderArea() {
|
function LoaderArea() {
|
||||||
return (
|
return (
|
||||||
<div className={styles.loaderWrap}>
|
<div className={styles.loaderWrap}>
|
||||||
@ -21,12 +28,7 @@ export default function FileIcon({
|
|||||||
className,
|
className,
|
||||||
small,
|
small,
|
||||||
isLoading
|
isLoading
|
||||||
}: {
|
}: FileIconProps): ReactElement {
|
||||||
file: FileMetadata
|
|
||||||
className?: string
|
|
||||||
small?: boolean
|
|
||||||
isLoading?: boolean
|
|
||||||
}): ReactElement {
|
|
||||||
const styleClasses = cx({
|
const styleClasses = cx({
|
||||||
file: true,
|
file: true,
|
||||||
small,
|
small,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user