diff --git a/embark-ui/src/components/Accounts.js b/embark-ui/src/components/Accounts.js index eb0116cf..36aea7be 100644 --- a/embark-ui/src/components/Accounts.js +++ b/embark-ui/src/components/Accounts.js @@ -8,32 +8,34 @@ import CardTitleIdenticon from './CardTitleIdenticon'; const Accounts = ({accounts}) => ( -

Accounts

- {accounts.map(account => ( - - + + +

Accounts

+
+ + {accounts.map(account => ( +
Account  {account.address} - - - - - Balance -
{account.balance} Ether
- - - Tx Count -
{account.transactionCount}
- - - Index -
{account.index}
- -
-
- - ))} + + + Balance +
{account.balance} Ether
+ + + Tx Count +
{account.transactionCount}
+ + + Index +
{account.index}
+ +
+
+ ))} +
+
); diff --git a/embark-ui/src/components/Blocks.js b/embark-ui/src/components/Blocks.js index 3ae9bb9e..ba27fbd0 100644 --- a/embark-ui/src/components/Blocks.js +++ b/embark-ui/src/components/Blocks.js @@ -4,48 +4,50 @@ import {Row, Col, Card, CardHeader, CardBody} from 'reactstrap'; import PropTypes from 'prop-types'; import CardTitleIdenticon from './CardTitleIdenticon'; +import LoadMore from "./LoadMore"; -const Blocks = ({blocks}) => ( +const Blocks = ({blocks, showLoadMore, loadMore}) => ( -

Blocks

- {blocks.map(block => ( - - - Block  - - {block.number} - - - - - - - Number -
{block.number}
- - - Mined On -
{new Date(block.timestamp * 1000).toLocaleString()}
- - - Gas Used -
{block.gasUsed}
- - - TX Count -
{block.transactions.length}
- -
-
-
- ))} + + +

Blocks

+
+ + {blocks.map(block => ( +
+ Block  + + {block.number} + + + + + Mined On +
{new Date(block.timestamp * 1000).toLocaleString()}
+ + + Gas Used +
{block.gasUsed}
+ + + TX Count +
{block.transactions.length}
+ +
+
+ ))} + {showLoadMore && loadMore()}/>} +
+
); Blocks.propTypes = { - blocks: PropTypes.arrayOf(PropTypes.object) + blocks: PropTypes.arrayOf(PropTypes.object), + showLoadMore: PropTypes.bool, + loadMore: PropTypes.func }; export default Blocks; diff --git a/embark-ui/src/components/CardTitleIdenticon.js b/embark-ui/src/components/CardTitleIdenticon.js index e34d8886..f0576ff3 100644 --- a/embark-ui/src/components/CardTitleIdenticon.js +++ b/embark-ui/src/components/CardTitleIdenticon.js @@ -1,9 +1,20 @@ +import PropTypes from "prop-types"; import React from 'react'; import {CardTitle} from 'reactstrap'; import Blockies from 'react-blockies'; const CardTitleIdenticon = ({id, children}) => ( - {children} -) + + {children} + +); -export default CardTitleIdenticon +CardTitleIdenticon.propTypes = { + id: PropTypes.string, + children: PropTypes.oneOfType([ + PropTypes.object, + PropTypes.array + ]) +}; + +export default CardTitleIdenticon; diff --git a/embark-ui/src/components/Explorer.css b/embark-ui/src/components/Explorer.css new file mode 100644 index 00000000..80964c1f --- /dev/null +++ b/embark-ui/src/components/Explorer.css @@ -0,0 +1,14 @@ +.explorer-row { + border-top-width: 0 !important; /*Bootstrap uses important, so we need to override it*/ +} + +.explorer-row + .explorer-row { + margin-top: 5px; + padding-top: 20px; + border-top-width: 1px !important; +} + +.explorer-row .text-truncate { + width: 90%; + display: inline-block; +} diff --git a/embark-ui/src/components/ExplorerDashboardLayout.js b/embark-ui/src/components/ExplorerDashboardLayout.js index 64a5e479..e510c1de 100644 --- a/embark-ui/src/components/ExplorerDashboardLayout.js +++ b/embark-ui/src/components/ExplorerDashboardLayout.js @@ -8,9 +8,11 @@ import AccountsContainer from '../containers/AccountsContainer'; import BlocksContainer from '../containers/BlocksContainer'; import TransactionsContainer from '../containers/TransactionsContainer'; +import './Explorer.css'; + const ExplorerDashboardLayout = () => ( - + diff --git a/embark-ui/src/components/Transactions.js b/embark-ui/src/components/Transactions.js index afe78984..1a80121f 100644 --- a/embark-ui/src/components/Transactions.js +++ b/embark-ui/src/components/Transactions.js @@ -4,48 +4,54 @@ import {Row, Col, Card, CardHeader, CardBody} from 'reactstrap'; import PropTypes from 'prop-types'; import CardTitleIdenticon from './CardTitleIdenticon'; +import LoadMore from "./LoadMore"; -const Transactions = ({transactions}) => ( +const Transactions = ({transactions, showLoadMore, loadMore}) => ( -

Transactions

- {transactions.map(transaction => ( - - - Transaction  - - {transaction.hash} - - - - - - - Block number -
{transaction.blockNumber}
- - - From -
{transaction.from}
- - - To -
{transaction.to}
- - - Type -
{transaction.to ? "Contract Call" : "Contract Creation"}
- -
-
-
- ))} + + +

Transactions

+
+ + {transactions.map(transaction => ( +
+ Transaction  + + {transaction.hash} + + + + + Block number +
{transaction.blockNumber}
+ + + From +
{transaction.from}
+ + + To +
{transaction.to}
+ + + Type +
{transaction.to ? "Contract Call" : "Contract Creation"}
+ +
+
+ ))} + {showLoadMore && loadMore()}/>} +
+
); Transactions.propTypes = { - transactions: PropTypes.arrayOf(PropTypes.object) + transactions: PropTypes.arrayOf(PropTypes.object), + showLoadMore: PropTypes.bool, + loadMore: PropTypes.func }; export default Transactions; diff --git a/embark-ui/src/containers/BlocksContainer.js b/embark-ui/src/containers/BlocksContainer.js index 7420a01e..1163214f 100644 --- a/embark-ui/src/containers/BlocksContainer.js +++ b/embark-ui/src/containers/BlocksContainer.js @@ -5,7 +5,6 @@ import PropTypes from 'prop-types'; import {blocks as blocksAction, initBlockHeader, stopBlockHeader} from '../actions'; import Blocks from '../components/Blocks'; import DataWrapper from "../components/DataWrapper"; -import LoadMore from "../components/LoadMore"; import {getBlocks} from "../reducers/selectors"; class BlocksContainer extends Component { @@ -34,9 +33,8 @@ class BlocksContainer extends Component { return ( 0} {...this.props} render={({blocks}) => ( - + = 0)} loadMore={() => this.loadMore()} /> )} /> - {(this.loadMoreFrom() >= 0) ? this.loadMore()} /> : } ); } diff --git a/embark-ui/src/containers/TransactionsContainer.js b/embark-ui/src/containers/TransactionsContainer.js index b50807c3..861709b1 100644 --- a/embark-ui/src/containers/TransactionsContainer.js +++ b/embark-ui/src/containers/TransactionsContainer.js @@ -3,7 +3,6 @@ import {connect} from 'react-redux'; import PropTypes from 'prop-types'; import {transactions as transactionsAction, initBlockHeader, stopBlockHeader} from '../actions'; -import LoadMore from "../components/LoadMore"; import Transactions from '../components/Transactions'; import DataWrapper from "../components/DataWrapper"; import {getTransactions} from "../reducers/selectors"; @@ -34,9 +33,9 @@ class TransactionsContainer extends Component { return ( 0} {...this.props} render={({transactions}) => ( - + = 0)} loadMore={() => this.loadMore()} /> )} /> - {(this.loadMoreFrom() > 0) ? this.loadMore()} /> : } ); }