From 7eb16ceaf1fc2cd227c759edd62b806dad419169 Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Tue, 21 Aug 2018 14:42:50 -0400 Subject: [PATCH] added addr table --- .../table/accounts/accountsTable.js | 5 +--- .../table/accounts/detailAccountsRow.js | 24 +++++++---------- .../table/accounts/detailAccountsTable.js | 18 ++++++------- .../src/components/table/accounts/table.css | 26 +++++++++++++++++++ shyftBlockExplorerUI/src/containers/App.js | 11 +++----- 5 files changed, 50 insertions(+), 34 deletions(-) diff --git a/shyftBlockExplorerUI/src/components/table/accounts/accountsTable.js b/shyftBlockExplorerUI/src/components/table/accounts/accountsTable.js index 910bc0918e..a273875d80 100644 --- a/shyftBlockExplorerUI/src/components/table/accounts/accountsTable.js +++ b/shyftBlockExplorerUI/src/components/table/accounts/accountsTable.js @@ -3,14 +3,11 @@ import classes from './accounts.css'; import { Link } from 'react-router-dom' const AccountsTable = (props) => { - - console.log(props); - return ( {props.Rank} - props.detailAccountHandler(props.Addr)}> + props.detailAccountHandler(props.Addr)}> {props.Addr} {props.Balance} diff --git a/shyftBlockExplorerUI/src/components/table/accounts/detailAccountsRow.js b/shyftBlockExplorerUI/src/components/table/accounts/detailAccountsRow.js index 22f7655aca..84a814e173 100644 --- a/shyftBlockExplorerUI/src/components/table/accounts/detailAccountsRow.js +++ b/shyftBlockExplorerUI/src/components/table/accounts/detailAccountsRow.js @@ -7,16 +7,12 @@ class AccountTransactionTable extends Component { render() { - - console.log("inr"); - - + console.log(this.props); let table; - if(this.props.data.length <= 1) { + if(this.props.data.length < 1) { return }else { table = this.props.data.map((data, i) => { - console.log("DATA FROM MAP [AccountTransactionTable]", data) const costConversion = data.Cost / 10000000000000000000; const amountConversion = data.Amount / 10000000000000000000; return - TxHash - Block - Age - From - - To - Value - TxFee + TxHash + Block + Age + From + + To + Value + TxFee {table} diff --git a/shyftBlockExplorerUI/src/components/table/accounts/detailAccountsTable.js b/shyftBlockExplorerUI/src/components/table/accounts/detailAccountsTable.js index 7017b444b5..d8ee77b005 100644 --- a/shyftBlockExplorerUI/src/components/table/accounts/detailAccountsTable.js +++ b/shyftBlockExplorerUI/src/components/table/accounts/detailAccountsTable.js @@ -17,18 +17,18 @@ const DetailAccountsTable = (props) => { } return ( - - - props.detailTransactionHandler(props.txHash)}> + + + props.detailTransactionHandler(props.txHash)}> {props.txHash} - {props.blockNumber} - {props.age} - {props.from} + {props.blockNumber} + {props.age} + {props.from}
{ flag ? "IN" : "OUT" }
- {props.to} - {props.value} - {props.cost} + {props.to} + {props.value} + {props.cost} ) diff --git a/shyftBlockExplorerUI/src/components/table/accounts/table.css b/shyftBlockExplorerUI/src/components/table/accounts/table.css index cfe347bdd1..5f7c847b1f 100644 --- a/shyftBlockExplorerUI/src/components/table/accounts/table.css +++ b/shyftBlockExplorerUI/src/components/table/accounts/table.css @@ -24,3 +24,29 @@ td { color: black; } +.incoming { + height: 25px; + width: 35px; + border: 1px forestgreen; + border-radius: 5px; + background-color: #4f2e7e; + color: white; + font-size: 1rem; + text-transform: uppercase; + text-align: center; + vertical-align: middle; +} + +.out { + height: 25px; + width: 35px; + border: 1px orangered; + border-radius: 5px; + background-color: orangered; + color: white; + font-size: .8rem; + text-transform: uppercase; + text-align: center; + vertical-align: middle; +} + diff --git a/shyftBlockExplorerUI/src/containers/App.js b/shyftBlockExplorerUI/src/containers/App.js index 224f3a3dab..e75db4b580 100644 --- a/shyftBlockExplorerUI/src/containers/App.js +++ b/shyftBlockExplorerUI/src/containers/App.js @@ -107,7 +107,6 @@ class App extends Component { getBlockData = (data, page) => { let components = []; - console.log("ACCOUNT DATA", data) let dataEntry; if(page === "account") { @@ -117,8 +116,10 @@ class App extends Component { } for (let key in dataEntry) { - let value = dataEntry[key] - // console.log(key, value) + let value = dataEntry[key]; + if (dataEntry["To"] === null) { + delete dataEntry["To"] + } components.push( @@ -224,8 +225,6 @@ class App extends Component {
-
} @@ -243,8 +242,6 @@ class App extends Component {
-