Skip to content
This repository has been archived by the owner on Dec 31, 2024. It is now read-only.

Commit

Permalink
Changed token column to display token name
Browse files Browse the repository at this point in the history
Changed token column to display token name instead of token address
  • Loading branch information
bowensanders authored Feb 25, 2019
1 parent c2125db commit fe5cb35
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/components/PaymentsTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ class PaymentsTable extends Component {
return 'Pending';
};

getTokenName = (tokenAddress) => {
if (tokenAddress === "0x0000000000000000000000000000000000000000") return 'ETH';
else if (tokenAddress === "0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359") return 'DAI';
else return tokenAddress;
};

render() {
const columns = [
{
Expand All @@ -75,7 +81,7 @@ class PaymentsTable extends Component {
id: 'payTime',
Header: 'Earliest Pay Time',
accessor: datum => new Date(datum.earliestPayTime).toUTCString(),
width: 250,
width: 220,
sortable: false,
},
{
Expand All @@ -94,12 +100,13 @@ class PaymentsTable extends Component {
id: 'amount',
Header: 'Amount',
accessor: datum => parseFloat(Web3.utils.fromWei(datum.event.returnValues.amount)),
width: 100,
width: 150,
},
{
id: 'token',
Header: 'Token',
accessor: datum => datum.event.returnValues.token,
accessor: datum => this.getTokenName(datum.event.returnValues.token),
width: 60,
},
{
id: 'reference',
Expand Down

0 comments on commit fe5cb35

Please sign in to comment.