From 308200b01848b0c33ef7bbdb9e1b77bf6b9e02d5 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Wed, 30 Sep 2020 19:14:37 +0200 Subject: [PATCH] asset title fetching --- src/components/pages/History/PoolTransactions.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/pages/History/PoolTransactions.tsx b/src/components/pages/History/PoolTransactions.tsx index 6d7d0cc25..0f692fe32 100644 --- a/src/components/pages/History/PoolTransactions.tsx +++ b/src/components/pages/History/PoolTransactions.tsx @@ -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 {title || did} +} + 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 {did} + return } },