mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
fixes
This commit is contained in:
parent
be44ee4f2b
commit
7a7e493f6e
@ -36,9 +36,9 @@ function MarketMetadataProvider({
|
|||||||
|
|
||||||
opcData.push({
|
opcData.push({
|
||||||
chainId: appConfig.chainIdsSupported[i],
|
chainId: appConfig.chainIdsSupported[i],
|
||||||
approvedTokens: response.data?.opc.approvedTokens?.map((x) => x.id),
|
approvedTokens: response?.data?.opc.approvedTokens?.map((x) => x.id),
|
||||||
swapApprovedFee: response.data?.opc.swapOceanFee,
|
swapApprovedFee: response?.data?.opc.swapOceanFee,
|
||||||
swapNotApprovedFee: response.data?.opc.swapNonOceanFee
|
swapNotApprovedFee: response?.data?.opc.swapNonOceanFee
|
||||||
} as OpcFee)
|
} as OpcFee)
|
||||||
}
|
}
|
||||||
setOpcFees(opcData)
|
setOpcFees(opcData)
|
||||||
|
@ -3,11 +3,8 @@ import { ComponentStory, ComponentMeta } from '@storybook/react'
|
|||||||
import AssetComputeList, {
|
import AssetComputeList, {
|
||||||
AssetComputeListProps
|
AssetComputeListProps
|
||||||
} from '@shared/AssetList/AssetComputeList'
|
} from '@shared/AssetList/AssetComputeList'
|
||||||
import {
|
import { assetSelectionAsset } from '../../../../../.storybook/__mockdata__'
|
||||||
assetSelectionAsset,
|
import MarketMetadataProvider from '@context/MarketMetadata'
|
||||||
locale,
|
|
||||||
prices
|
|
||||||
} from '../../../../../.storybook/__mockdata__'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: 'Component/@shared/AssetList/AssetComputeList',
|
title: 'Component/@shared/AssetList/AssetComputeList',
|
||||||
@ -16,7 +13,13 @@ export default {
|
|||||||
|
|
||||||
const Template: ComponentStory<typeof AssetComputeList> = (
|
const Template: ComponentStory<typeof AssetComputeList> = (
|
||||||
args: AssetComputeListProps
|
args: AssetComputeListProps
|
||||||
) => <AssetComputeList {...args} />
|
) => {
|
||||||
|
return (
|
||||||
|
<MarketMetadataProvider>
|
||||||
|
<AssetComputeList {...args} />
|
||||||
|
</MarketMetadataProvider>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
args: AssetComputeListProps
|
args: AssetComputeListProps
|
||||||
|
@ -3,7 +3,7 @@ import { ComponentStory, ComponentMeta } from '@storybook/react'
|
|||||||
import AssetListTitle, {
|
import AssetListTitle, {
|
||||||
AssetListTitleProps
|
AssetListTitleProps
|
||||||
} from '@shared/AssetList/AssetListTitle'
|
} from '@shared/AssetList/AssetListTitle'
|
||||||
import { asset } from '../../../../../.storybook/__mockdata__'
|
import MarketMetadataProvider from '@context/MarketMetadata'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: 'Component/@shared/AssetList/AssetListTitle',
|
title: 'Component/@shared/AssetList/AssetListTitle',
|
||||||
@ -12,7 +12,13 @@ export default {
|
|||||||
|
|
||||||
const Template: ComponentStory<typeof AssetListTitle> = (
|
const Template: ComponentStory<typeof AssetListTitle> = (
|
||||||
args: AssetListTitleProps
|
args: AssetListTitleProps
|
||||||
) => <AssetListTitle {...args} />
|
) => {
|
||||||
|
return (
|
||||||
|
<MarketMetadataProvider>
|
||||||
|
<AssetListTitle {...args} />
|
||||||
|
</MarketMetadataProvider>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
args: AssetListTitleProps
|
args: AssetListTitleProps
|
||||||
|
@ -4,6 +4,8 @@ import AssetSelection, {
|
|||||||
AssetSelectionProps
|
AssetSelectionProps
|
||||||
} from '@shared/FormFields/AssetSelection'
|
} from '@shared/FormFields/AssetSelection'
|
||||||
import { assetSelectionAsset } from '../../../../../.storybook/__mockdata__'
|
import { assetSelectionAsset } from '../../../../../.storybook/__mockdata__'
|
||||||
|
import MarketMetadataProvider from '@context/MarketMetadata'
|
||||||
|
import { UserPreferencesProvider } from '@context/UserPreferences'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: 'Component/@shared/FormFields/AssetSelection',
|
title: 'Component/@shared/FormFields/AssetSelection',
|
||||||
@ -12,8 +14,15 @@ export default {
|
|||||||
|
|
||||||
const Template: ComponentStory<typeof AssetSelection> = (
|
const Template: ComponentStory<typeof AssetSelection> = (
|
||||||
args: AssetSelectionProps
|
args: AssetSelectionProps
|
||||||
) => <AssetSelection {...args} />
|
) => {
|
||||||
|
return (
|
||||||
|
<MarketMetadataProvider>
|
||||||
|
<UserPreferencesProvider>
|
||||||
|
<AssetSelection {...args} />
|
||||||
|
</UserPreferencesProvider>
|
||||||
|
</MarketMetadataProvider>
|
||||||
|
)
|
||||||
|
}
|
||||||
interface Props {
|
interface Props {
|
||||||
args: AssetSelectionProps
|
args: AssetSelectionProps
|
||||||
}
|
}
|
||||||
|
@ -24,3 +24,16 @@ Default.args = {
|
|||||||
</a>
|
</a>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const WithDescription: Props = Template.bind({})
|
||||||
|
WithDescription.args = {
|
||||||
|
...Default.args,
|
||||||
|
description:
|
||||||
|
'Data owners and consumers use Ocean Market app to publish, discover, and consume data in a secure, privacy-preserving fashion. OCEAN holders stake liquidity to data pools.'
|
||||||
|
}
|
||||||
|
|
||||||
|
export const WithTitle: Props = Template.bind({})
|
||||||
|
WithTitle.args = {
|
||||||
|
...WithDescription.args,
|
||||||
|
title: 'Ocean Market'
|
||||||
|
}
|
||||||
|
30
src/components/@shared/Pagination/index.stories.tsx
Normal file
30
src/components/@shared/Pagination/index.stories.tsx
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
||||||
|
import Pagination from '@shared/Pagination'
|
||||||
|
import { PaginationProps } from './_types'
|
||||||
|
import { UserPreferencesProvider } from '@context/UserPreferences'
|
||||||
|
import MarketMetadataProvider from '@context/MarketMetadata'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
title: 'Component/@shared/Pagination',
|
||||||
|
component: Pagination
|
||||||
|
} as ComponentMeta<typeof Pagination>
|
||||||
|
|
||||||
|
const Template: ComponentStory<typeof Pagination> = (args: PaginationProps) => {
|
||||||
|
return (
|
||||||
|
<MarketMetadataProvider>
|
||||||
|
<Pagination {...args} />
|
||||||
|
</MarketMetadataProvider>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
args: PaginationProps
|
||||||
|
}
|
||||||
|
|
||||||
|
export const Default: Props = Template.bind({})
|
||||||
|
Default.args = {
|
||||||
|
totalPages: 10,
|
||||||
|
currentPage: 1,
|
||||||
|
rowsPerPage: 3
|
||||||
|
}
|
@ -1,9 +1,8 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
||||||
import PriceUnit, { PriceUnitProps } from '@shared/Price/PriceUnit'
|
import PriceUnit, { PriceUnitProps } from '@shared/Price/PriceUnit'
|
||||||
import MarketMetadataProvider from '@context/MarketMetadata'
|
|
||||||
import PricesProvider from '@context/Prices'
|
|
||||||
import { UserPreferencesProvider } from '@context/UserPreferences'
|
import { UserPreferencesProvider } from '@context/UserPreferences'
|
||||||
|
import MarketMetadataProvider from '@context/MarketMetadata'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: 'Component/@shared/Price/PriceUnit',
|
title: 'Component/@shared/Price/PriceUnit',
|
||||||
|
12
src/components/@shared/Publisher/Add/index.stories.tsx
Normal file
12
src/components/@shared/Publisher/Add/index.stories.tsx
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
||||||
|
import Add from '@shared/Publisher/Add'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
title: 'Component/@shared/Add',
|
||||||
|
component: Add
|
||||||
|
} as ComponentMeta<typeof Add>
|
||||||
|
|
||||||
|
const Template: ComponentStory<typeof Add> = () => <Add />
|
||||||
|
|
||||||
|
export const Default = Template.bind({})
|
28
src/components/@shared/Publisher/index.stories.tsx
Normal file
28
src/components/@shared/Publisher/index.stories.tsx
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
||||||
|
import Publisher, { PublisherProps } from '@shared/Publisher'
|
||||||
|
import MarketMetadataProvider from '@context/MarketMetadata'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
title: 'Component/@shared/Publisher',
|
||||||
|
component: Publisher
|
||||||
|
} as ComponentMeta<typeof Publisher>
|
||||||
|
|
||||||
|
const Template: ComponentStory<typeof Publisher> = (args: PublisherProps) => (
|
||||||
|
<Publisher {...args} />
|
||||||
|
)
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
args: PublisherProps
|
||||||
|
}
|
||||||
|
|
||||||
|
export const Default: Props = Template.bind({})
|
||||||
|
Default.args = {
|
||||||
|
account: '0x134B4eDd7dE8Ea003E721e7670800BA97D9AF1fd'
|
||||||
|
}
|
||||||
|
|
||||||
|
export const MinimalProfile: Props = Template.bind({})
|
||||||
|
MinimalProfile.args = {
|
||||||
|
account: '0x134B4eDd7dE8Ea003E721e7670800BA97D9AF1fd',
|
||||||
|
minimal: true
|
||||||
|
}
|
@ -10,15 +10,17 @@ import { useIsMounted } from '@hooks/useIsMounted'
|
|||||||
|
|
||||||
const cx = classNames.bind(styles)
|
const cx = classNames.bind(styles)
|
||||||
|
|
||||||
|
export interface PublisherProps {
|
||||||
|
account: string
|
||||||
|
minimal?: boolean
|
||||||
|
className?: string
|
||||||
|
}
|
||||||
|
|
||||||
export default function Publisher({
|
export default function Publisher({
|
||||||
account,
|
account,
|
||||||
minimal,
|
minimal,
|
||||||
className
|
className
|
||||||
}: {
|
}: PublisherProps): ReactElement {
|
||||||
account: string
|
|
||||||
minimal?: boolean
|
|
||||||
className?: string
|
|
||||||
}): ReactElement {
|
|
||||||
const isMounted = useIsMounted()
|
const isMounted = useIsMounted()
|
||||||
const [profile, setProfile] = useState<Profile>()
|
const [profile, setProfile] = useState<Profile>()
|
||||||
const [name, setName] = useState('')
|
const [name, setName] = useState('')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user