1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-11-16 02:04:54 +01:00

useMetadata fixes

This commit is contained in:
Matthias Kretschmann 2020-08-20 16:59:17 +02:00
parent e114c3f650
commit 9e37127360
Signed by: m
GPG Key ID: 606EEEF3C479A91F
6 changed files with 8 additions and 10 deletions

6
package-lock.json generated
View File

@ -3232,9 +3232,9 @@
} }
}, },
"@oceanprotocol/react": { "@oceanprotocol/react": {
"version": "0.0.38", "version": "0.0.40",
"resolved": "https://registry.npmjs.org/@oceanprotocol/react/-/react-0.0.38.tgz", "resolved": "https://registry.npmjs.org/@oceanprotocol/react/-/react-0.0.40.tgz",
"integrity": "sha512-ij7/8B1BsX+ZwKJGkXq7KdbHBwnAZyreIpJK4etksaSt0PjC5KbizfM4ElnED7VVkckqhgp+6W5nx9+6ULBeGA==", "integrity": "sha512-E6t55oZAXZumqFuuBug/0U3PLNC5zqdJ4qbo6bAO2oyUdQggSXNScE3D+NbsjhIgIykXTSSYgj15yuSlvfqLcA==",
"requires": { "requires": {
"@oceanprotocol/lib": "^0.1.12", "@oceanprotocol/lib": "^0.1.12",
"axios": "^0.19.2", "axios": "^0.19.2",

View File

@ -23,7 +23,7 @@
"@loadable/component": "^5.13.1", "@loadable/component": "^5.13.1",
"@oceanprotocol/art": "^3.0.0", "@oceanprotocol/art": "^3.0.0",
"@oceanprotocol/lib": "^0.1.14", "@oceanprotocol/lib": "^0.1.14",
"@oceanprotocol/react": "0.0.38", "@oceanprotocol/react": "^0.0.40",
"@oceanprotocol/typographies": "^0.1.0", "@oceanprotocol/typographies": "^0.1.0",
"@sindresorhus/slugify": "^1.0.0", "@sindresorhus/slugify": "^1.0.0",
"@tippyjs/react": "^4.1.0", "@tippyjs/react": "^4.1.0",

View File

@ -18,7 +18,7 @@ export default function Price({
conversion?: boolean conversion?: boolean
}): ReactElement { }): ReactElement {
const { ocean } = useOcean() const { ocean } = useOcean()
const { price } = useMetadata(ddo.id) const { price } = useMetadata(ddo)
return !ocean ? ( return !ocean ? (
<div className={styles.empty}>Connect your wallet to view price</div> <div className={styles.empty}>Connect your wallet to view price</div>

View File

@ -1,12 +1,10 @@
import React, { useState, useEffect } from 'react' import React from 'react'
import { Link } from 'gatsby' import { Link } from 'gatsby'
import Dotdotdot from 'react-dotdotdot' import Dotdotdot from 'react-dotdotdot'
import { MetadataMarket } from '../../@types/Metadata' import { MetadataMarket } from '../../@types/Metadata'
import Price from '../atoms/Price' import Price from '../atoms/Price'
import styles from './AssetTeaser.module.css' import styles from './AssetTeaser.module.css'
import { useMetadata } from '@oceanprotocol/react'
import { DDO } from '@oceanprotocol/lib' import { DDO } from '@oceanprotocol/lib'
import Loader from '../atoms/Loader'
declare type AssetTeaserProps = { declare type AssetTeaserProps = {
ddo: DDO ddo: DDO

View File

@ -19,7 +19,7 @@ interface Balance {
export default function Pool({ ddo }: { ddo: DDO }): ReactElement { export default function Pool({ ddo }: { ddo: DDO }): ReactElement {
const { ocean, accountId } = useOcean() const { ocean, accountId } = useOcean()
const { price, poolAddress } = useMetadata(ddo.id) const { price, poolAddress } = useMetadata(ddo)
const [poolTokens, setPoolTokens] = useState<string>() const [poolTokens, setPoolTokens] = useState<string>()
const [totalBalance, setTotalBalance] = useState<Balance>() const [totalBalance, setTotalBalance] = useState<Balance>()

View File

@ -17,7 +17,7 @@ export default function AssetActions({
ddo: DDO ddo: DDO
}): ReactElement { }): ReactElement {
const { balance } = useOcean() const { balance } = useOcean()
const { price } = useMetadata(ddo.id) const { price } = useMetadata(ddo)
const [isBalanceSufficient, setIsBalanceSufficient] = useState<boolean>() const [isBalanceSufficient, setIsBalanceSufficient] = useState<boolean>()
const isCompute = Boolean(ddo.findServiceByType('compute')) const isCompute = Boolean(ddo.findServiceByType('compute'))