Transactions
diff --git a/shyftBlockExplorerUI/src/components/table/accounts/accountRows.js b/shyftBlockExplorerUI/src/components/table/accounts/accountRows.js
index 99db9d6dbe..fdd78a2766 100644
--- a/shyftBlockExplorerUI/src/components/table/accounts/accountRows.js
+++ b/shyftBlockExplorerUI/src/components/table/accounts/accountRows.js
@@ -21,15 +21,26 @@ class AccountTable extends Component {
}
render() {
- const table = this.state.data.map((data, i) => {
+
+ let startNum = 1;
+ const sorted = [...this.state.data];
+ sorted.sort((a, b) => a.Balance > b.Balance);
+ const table = sorted.reverse().map((data, i) => {
+ const conversion = data.Balance / 1000000000000000000;
+ const total = sorted
+ .map(num => num.Balance / 1000000000000000000)
+ .reduce((acc, cur) => acc + cur ,0);
+ const percentage = ( (conversion / total) *100);
return
- })
+ });
let combinedClasses = ['responsive-table', classes.table];
return (
diff --git a/shyftBlockExplorerUI/src/components/table/accounts/accountsTable.js b/shyftBlockExplorerUI/src/components/table/accounts/accountsTable.js
index 152dde6c42..744e5e465f 100644
--- a/shyftBlockExplorerUI/src/components/table/accounts/accountsTable.js
+++ b/shyftBlockExplorerUI/src/components/table/accounts/accountsTable.js
@@ -6,12 +6,12 @@ const AccountsTable = (props) => {
return (
- 1
+ {props.Rank}
props.detailAccountHandler(props.Addr)}>
{props.Addr}
{props.Balance}
- 12.01%
+ {props.Percentage}%
{props.TxCountAccount}
diff --git a/shyftBlockExplorerUI/src/components/table/accounts/detailAccountsTable.js b/shyftBlockExplorerUI/src/components/table/accounts/detailAccountsTable.js
index 4b7cedb9d1..ddeabc50fd 100644
--- a/shyftBlockExplorerUI/src/components/table/accounts/detailAccountsTable.js
+++ b/shyftBlockExplorerUI/src/components/table/accounts/detailAccountsTable.js
@@ -9,11 +9,17 @@ const DetailAccountsTable = (props) => {
}else {
flag = false
}
+ let genFlag;
+ if(props.txHash.indexOf("GENESIS") !== -1) {
+ genFlag = false
+ }else {
+ genFlag = true
+ }
return (
- props.detailTransactionHandler(props.txHash)}>
+ props.detailTransactionHandler(props.txHash)}>
{props.txHash}
{props.blockNumber}
diff --git a/shyftBlockExplorerUI/src/components/table/accounts/table.css b/shyftBlockExplorerUI/src/components/table/accounts/table.css
index 0dd7b521e7..e191b21ee3 100644
--- a/shyftBlockExplorerUI/src/components/table/accounts/table.css
+++ b/shyftBlockExplorerUI/src/components/table/accounts/table.css
@@ -77,4 +77,9 @@ th {
text-transform: uppercase;
text-align: center;
vertical-align: middle;
+}
+
+.disabled {
+ pointer-events: none;
+ color: black;
}
\ No newline at end of file
diff --git a/shyftBlockExplorerUI/src/components/table/blocks/blockRows.js b/shyftBlockExplorerUI/src/components/table/blocks/blockRows.js
index 900f3cf1d5..826f29452b 100644
--- a/shyftBlockExplorerUI/src/components/table/blocks/blockRows.js
+++ b/shyftBlockExplorerUI/src/components/table/blocks/blockRows.js
@@ -1,5 +1,6 @@
import React, { Component } from 'react';
import BlockTable from './blockTable';
+import Loading from '../../UI materials/loading'
import classes from './table.css';
import axios from "axios/index";
@@ -35,7 +36,7 @@ class BlocksTable extends Component {
TxCount={data.TxCount}
detailBlockHandler={this.props.detailBlockHandler}
/>
- })
+ });
let combinedClasses = ['responsive-table', classes.table];
return (
@@ -54,7 +55,7 @@ class BlocksTable extends Component {
Reward
- {table}
+ {table}
);
}
diff --git a/shyftBlockExplorerUI/src/components/table/blocks/blockTable.js b/shyftBlockExplorerUI/src/components/table/blocks/blockTable.js
index aa66bee9f2..81aabfeaad 100644
--- a/shyftBlockExplorerUI/src/components/table/blocks/blockTable.js
+++ b/shyftBlockExplorerUI/src/components/table/blocks/blockTable.js
@@ -16,8 +16,8 @@ const BlockTable = (props) => {
{props.Coinbase}
{props.GasUsed}
{props.GasLimit}
- 12.01
- 3.2
+ TBD
+ TBD
)
diff --git a/shyftBlockExplorerUI/src/components/table/transactions/transactionRow.js b/shyftBlockExplorerUI/src/components/table/transactions/transactionRow.js
index 76bd341d5c..0806cf78c9 100644
--- a/shyftBlockExplorerUI/src/components/table/transactions/transactionRow.js
+++ b/shyftBlockExplorerUI/src/components/table/transactions/transactionRow.js
@@ -35,6 +35,7 @@ class TransactionTable extends Component {
value={data.Amount}
cost={data.Cost}
detailTransactionHandler={this.props.detailTransactionHandler}
+ detailAccountHandler={this.props.detailAccountHandler}
/>
})
diff --git a/shyftBlockExplorerUI/src/components/table/transactions/transactionTable.js b/shyftBlockExplorerUI/src/components/table/transactions/transactionTable.js
index a4b399efc5..ae32a137e9 100644
--- a/shyftBlockExplorerUI/src/components/table/transactions/transactionTable.js
+++ b/shyftBlockExplorerUI/src/components/table/transactions/transactionTable.js
@@ -5,7 +5,7 @@ import { Link } from 'react-router-dom'
const TransactionTable = (props) => {
let flag;
- if(props.txHash.indexOf("GENESIS") != -1) {
+ if(props.txHash.indexOf("GENESIS") !== -1) {
flag = false
}else {
flag = true
@@ -20,9 +20,9 @@ const TransactionTable = (props) => {
{props.blockNumber}
{props.age}
-
{props.from}
+
props.detailAccountHandler(props.from)}>{props.from}
-
{props.to}
+
props.detailAccountHandler(props.to)}>{props.to}
{props.value}
{props.cost}
diff --git a/shyftBlockExplorerUI/src/containers/App.js b/shyftBlockExplorerUI/src/containers/App.js
index f1561f6f63..3301e296c0 100644
--- a/shyftBlockExplorerUI/src/containers/App.js
+++ b/shyftBlockExplorerUI/src/containers/App.js
@@ -43,7 +43,7 @@ class App extends Component {
catch(error) {
console.log(error)
}
- }
+ };
detailTransactionHandler = async(txHash) => {
try {
@@ -53,7 +53,7 @@ class App extends Component {
catch(error) {
console.log(error)
}
- }
+ };
detailAccountHandler = async(addr) => {
try {
@@ -63,7 +63,7 @@ class App extends Component {
catch(error) {
console.log(error)
}
- }
+ };
render() {
return (
@@ -78,7 +78,9 @@ class App extends Component {
-
+
}
/>