From 9911c458a7075867c812670d36388741bcc81e8e Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Wed, 30 Sep 2020 18:38:36 +0200 Subject: [PATCH] refactor --- .../pages/History/PoolTransactions.tsx | 94 +++++++++---------- 1 file changed, 45 insertions(+), 49 deletions(-) diff --git a/src/components/pages/History/PoolTransactions.tsx b/src/components/pages/History/PoolTransactions.tsx index 623fc45c3..ca05d6ada 100644 --- a/src/components/pages/History/PoolTransactions.tsx +++ b/src/components/pages/History/PoolTransactions.tsx @@ -7,67 +7,63 @@ import EtherscanLink from '../../atoms/EtherscanLink' import Time from '../../atoms/Time' import styles from './PoolTransactions.module.css' +const columns = [ + { + name: 'Title', + selector: function getTitleRow(row: PoolTransaction) { + // TODO: replace hardcoded symbol with symbol fetching based + // on row.tonenIn & row.tokenOut + const title = row.tokenAmountIn + ? `Add ${row.tokenAmountIn} OCEAN` + : `Remove ${row.tokenAmountOut} OCEAN` + + return ( + + {title} + + ) + } + }, + { + name: 'Asset', + selector: function getAssetRow(row: PoolTransaction) { + const did = row.dtAddress.replace('0x', 'did:op:') + return {did} + } + }, + + { + name: 'Time', + selector: function getTimeRow(row: PoolTransaction) { + return ( +