1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-07-01 06:11:43 +02:00

changed way to get accessType, asset type declaration

This commit is contained in:
Norbi 2021-02-25 13:46:20 +02:00
parent a9e1ff1dbb
commit bee7c1ecbf
4 changed files with 15 additions and 21 deletions

View File

@ -19,7 +19,8 @@ const AssetTeaser: React.FC<AssetTeaserProps> = ({ ddo }: AssetTeaserProps) => {
const { attributes } = ddo.findServiceByType('metadata')
const { name, type } = attributes.main
const { dataTokenInfo } = ddo
const accessType = ddo.service[1].type
const isCompute = Boolean(ddo?.findServiceByType('compute'))
const accessType = isCompute ? 'compute' : 'access'
return (
<article className={`${styles.teaser} ${styles[type]}`}>

View File

@ -157,25 +157,17 @@ export default function Consume({
<div className={styles.filewrapper}>
<File file={file} />
</div>
{type === 'algorithm' ? (
<div className={styles.pricewrapper}>
This asset can not be downloaded, it can only be used in a compute
job
</div>
) : (
<div className={styles.pricewrapper}>
{isConsumable ? (
<Price ddo={ddo} conversion />
) : (
<div className={styles.help}>
There is not enough liquidity in the pool to buy this data set.
</div>
)}
{!isInPurgatory && <PurchaseButton />}
</div>
)}
<div className={styles.pricewrapper}>
{isConsumable ? (
<Price ddo={ddo} conversion />
) : (
<div className={styles.help}>
There is not enough liquidity in the pool to buy this data set.
</div>
)}
{!isInPurgatory && <PurchaseButton />}
</div>
</div>
<footer className={styles.feedback}>
<Web3Feedback isBalanceSufficient={isBalanceSufficient} />
</footer>

View File

@ -10,7 +10,8 @@ import AssetType from '../../atoms/AssetType'
export default function MetaMain(): ReactElement {
const { ddo, owner, type } = useAsset()
const { networkId } = useOcean()
const accessType = ddo.service[1].type
const isCompute = Boolean(ddo?.findServiceByType('compute'))
const accessType = isCompute ? 'compute' : 'access'
return (
<aside className={styles.meta}>

View File

@ -25,7 +25,7 @@ interface AssetProviderValue {
title: string | undefined
owner: string | undefined
price: BestPrice | undefined
type: string | undefined
type: 'dataset' | 'algorithm' | undefined
error?: string
refreshInterval: number
refreshDdo: (token?: CancelToken) => Promise<void>