mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
fixed PoolTransactions history refresh from history and asset detail transactions (#427)
This commit is contained in:
parent
7356981350
commit
a137177be6
@ -150,41 +150,41 @@ function Title({ row }: { row: TransactionHistoryPoolTransactions }) {
|
|||||||
) : null
|
) : null
|
||||||
}
|
}
|
||||||
|
|
||||||
function getColumns(minimal?: boolean) {
|
const columns = [
|
||||||
return [
|
{
|
||||||
{
|
name: 'Title',
|
||||||
name: 'Title',
|
selector: function getTitleRow(row: TransactionHistoryPoolTransactions) {
|
||||||
selector: function getTitleRow(row: TransactionHistoryPoolTransactions) {
|
return <Title row={row} />
|
||||||
return <Title row={row} />
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Data Set',
|
|
||||||
selector: function getAssetRow(row: TransactionHistoryPoolTransactions) {
|
|
||||||
const did = web3.utils
|
|
||||||
.toChecksumAddress(row.poolAddress.datatokenAddress)
|
|
||||||
.replace('0x', 'did:op:')
|
|
||||||
|
|
||||||
return <AssetTitle did={did} />
|
|
||||||
},
|
|
||||||
omit: minimal
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Time',
|
|
||||||
selector: function getTimeRow(row: TransactionHistoryPoolTransactions) {
|
|
||||||
return (
|
|
||||||
<Time
|
|
||||||
className={styles.time}
|
|
||||||
date={row.timestamp.toString()}
|
|
||||||
relative
|
|
||||||
isUnix
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
},
|
|
||||||
maxWidth: '10rem'
|
|
||||||
}
|
}
|
||||||
]
|
},
|
||||||
}
|
{
|
||||||
|
name: 'Data Set',
|
||||||
|
selector: function getAssetRow(row: TransactionHistoryPoolTransactions) {
|
||||||
|
const did = web3.utils
|
||||||
|
.toChecksumAddress(row.poolAddress.datatokenAddress)
|
||||||
|
.replace('0x', 'did:op:')
|
||||||
|
|
||||||
|
return <AssetTitle did={did} />
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Time',
|
||||||
|
selector: function getTimeRow(row: TransactionHistoryPoolTransactions) {
|
||||||
|
return (
|
||||||
|
<Time
|
||||||
|
className={styles.time}
|
||||||
|
date={row.timestamp.toString()}
|
||||||
|
relative
|
||||||
|
isUnix
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
maxWidth: '10rem'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
// hack! if we use a function to omit one field this will display a strange refresh to the enduser for each row
|
||||||
|
const columnsMinimal = [columns[0], columns[2]]
|
||||||
|
|
||||||
export default function PoolTransactions({
|
export default function PoolTransactions({
|
||||||
poolAddress,
|
poolAddress,
|
||||||
@ -214,7 +214,7 @@ export default function PoolTransactions({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Table
|
<Table
|
||||||
columns={getColumns(minimal)}
|
columns={minimal ? columnsMinimal : columns}
|
||||||
data={logs}
|
data={logs}
|
||||||
isLoading={loading}
|
isLoading={loading}
|
||||||
noTableHead={minimal}
|
noTableHead={minimal}
|
||||||
|
Loading…
Reference in New Issue
Block a user