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

asset title fetching

This commit is contained in:
Matthias Kretschmann 2020-09-30 19:14:37 +02:00
parent b76dc95f41
commit 308200b018
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -1,5 +1,5 @@
import { PoolTransaction } from '@oceanprotocol/lib/dist/node/balancer/OceanPool'
import { useOcean } from '@oceanprotocol/react'
import { useMetadata, useOcean } from '@oceanprotocol/react'
import { Link } from 'gatsby'
import React, { ReactElement, useEffect, useState } from 'react'
import DataTable from 'react-data-table-component'
@ -7,6 +7,11 @@ import EtherscanLink from '../../atoms/EtherscanLink'
import Time from '../../atoms/Time'
import styles from './PoolTransactions.module.css'
function AssetTitle({ did }: { did: string }): ReactElement {
const { title } = useMetadata(did)
return <Link to={`/asset/${did}`}>{title || did}</Link>
}
const columns = [
{
name: 'Title',
@ -25,10 +30,10 @@ const columns = [
}
},
{
name: 'Asset',
name: 'Data Set',
selector: function getAssetRow(row: PoolTransaction) {
const did = row.dtAddress.replace('0x', 'did:op:')
return <Link to={`/asset/${did}`}>{did}</Link>
return <AssetTitle did={did} />
}
},