From 2ed2f9388b58c38838358d049ddbc03cbe2e8f4e Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Wed, 24 Oct 2018 10:42:06 -0400 Subject: [PATCH 1/8] conflict in blocks --- embark-ui/src/components/Blocks.js | 70 ++++++++++--------- embark-ui/src/components/Explorer.css | 9 +++ .../src/components/ExplorerDashboardLayout.js | 2 + embark-ui/src/containers/BlocksContainer.js | 4 +- 4 files changed, 48 insertions(+), 37 deletions(-) create mode 100644 embark-ui/src/components/Explorer.css diff --git a/embark-ui/src/components/Blocks.js b/embark-ui/src/components/Blocks.js index 3ae9bb9e9..f57c1387a 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/Explorer.css b/embark-ui/src/components/Explorer.css new file mode 100644 index 000000000..29e9480df --- /dev/null +++ b/embark-ui/src/components/Explorer.css @@ -0,0 +1,9 @@ +.explorer-row { + margin-bottom: 20px; + padding-bottom: 5px; + border-bottom: 1px solid #c8ced3; +} + +.dark-theme .explorer-row { + border-bottom-color: #23282c; +} diff --git a/embark-ui/src/components/ExplorerDashboardLayout.js b/embark-ui/src/components/ExplorerDashboardLayout.js index 64a5e479a..4dcb3cf3d 100644 --- a/embark-ui/src/components/ExplorerDashboardLayout.js +++ b/embark-ui/src/components/ExplorerDashboardLayout.js @@ -8,6 +8,8 @@ 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/containers/BlocksContainer.js b/embark-ui/src/containers/BlocksContainer.js index 7420a01e5..1163214f5 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()} /> : } ); } From bc0a89fd6d1d2b9473d7d664ea060f851621d05d Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Wed, 24 Oct 2018 10:45:06 -0400 Subject: [PATCH 2/8] conflict in transactions --- .../src/components/CardTitleIdenticon.js | 14 +++- embark-ui/src/components/Explorer.css | 5 ++ embark-ui/src/components/Transactions.js | 74 ++++++++++--------- .../src/containers/TransactionsContainer.js | 5 +- 4 files changed, 59 insertions(+), 39 deletions(-) diff --git a/embark-ui/src/components/CardTitleIdenticon.js b/embark-ui/src/components/CardTitleIdenticon.js index e34d88863..0febddc1b 100644 --- a/embark-ui/src/components/CardTitleIdenticon.js +++ b/embark-ui/src/components/CardTitleIdenticon.js @@ -1,9 +1,17 @@ +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.object +}; + +export default CardTitleIdenticon; diff --git a/embark-ui/src/components/Explorer.css b/embark-ui/src/components/Explorer.css index 29e9480df..d3cb3b64b 100644 --- a/embark-ui/src/components/Explorer.css +++ b/embark-ui/src/components/Explorer.css @@ -7,3 +7,8 @@ .dark-theme .explorer-row { border-bottom-color: #23282c; } + +.explorer-row .text-truncate { + width: 90%; + display: inline-block; +} diff --git a/embark-ui/src/components/Transactions.js b/embark-ui/src/components/Transactions.js index afe789840..643bf3419 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/TransactionsContainer.js b/embark-ui/src/containers/TransactionsContainer.js index b50807c33..ef6c107e4 100644 --- a/embark-ui/src/containers/TransactionsContainer.js +++ b/embark-ui/src/containers/TransactionsContainer.js @@ -3,6 +3,7 @@ import {connect} from 'react-redux'; import PropTypes from 'prop-types'; import {transactions as transactionsAction, initBlockHeader, stopBlockHeader} from '../actions'; +import Blocks from "../components/Blocks"; import LoadMore from "../components/LoadMore"; import Transactions from '../components/Transactions'; import DataWrapper from "../components/DataWrapper"; @@ -34,9 +35,9 @@ class TransactionsContainer extends Component { return ( 0} {...this.props} render={({transactions}) => ( - + = 0)} loadMore={() => this.loadMore()} /> )} /> - {(this.loadMoreFrom() > 0) ? this.loadMore()} /> : } ); } From 3a1042d7a94287e3371b1ec250262f3e748567e6 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Wed, 24 Oct 2018 10:46:58 -0400 Subject: [PATCH 3/8] conflict in blocks and accounts --- embark-ui/src/components/Accounts.js | 48 ++++++++++++++------------- embark-ui/src/components/Blocks.js | 2 +- embark-ui/src/components/Explorer.css | 10 +++--- 3 files changed, 31 insertions(+), 29 deletions(-) diff --git a/embark-ui/src/components/Accounts.js b/embark-ui/src/components/Accounts.js index eb0116cfd..4f3524983 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 f57c1387a..0e994ae33 100644 --- a/embark-ui/src/components/Blocks.js +++ b/embark-ui/src/components/Blocks.js @@ -37,7 +37,7 @@ const Blocks = ({blocks, showLoadMore, loadMore}) => (
))} - {showLoadMore && loadMore()} />} + {showLoadMore && loadMore()}/>} diff --git a/embark-ui/src/components/Explorer.css b/embark-ui/src/components/Explorer.css index d3cb3b64b..352436539 100644 --- a/embark-ui/src/components/Explorer.css +++ b/embark-ui/src/components/Explorer.css @@ -1,11 +1,11 @@ -.explorer-row { - margin-bottom: 20px; - padding-bottom: 5px; - border-bottom: 1px solid #c8ced3; +.explorer-row + .explorer-row { + margin-top: 5px; + padding-top: 20px; + border-top: 1px solid #c8ced3; } .dark-theme .explorer-row { - border-bottom-color: #23282c; + border-top-color: #23282c; } .explorer-row .text-truncate { From 28a1303adf5b93a0529dd306582171acf0b29afd Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Wed, 24 Oct 2018 10:52:53 -0400 Subject: [PATCH 4/8] conflict in explorer layout --- embark-ui/src/components/Accounts.js | 2 +- embark-ui/src/components/Blocks.js | 2 +- embark-ui/src/components/ExplorerDashboardLayout.js | 2 +- embark-ui/src/components/Transactions.js | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/embark-ui/src/components/Accounts.js b/embark-ui/src/components/Accounts.js index 4f3524983..e153c48b9 100644 --- a/embark-ui/src/components/Accounts.js +++ b/embark-ui/src/components/Accounts.js @@ -10,7 +10,7 @@ const Accounts = ({accounts}) => ( -

Accounts

+

Accounts

{accounts.map(account => ( diff --git a/embark-ui/src/components/Blocks.js b/embark-ui/src/components/Blocks.js index 0e994ae33..ca63a13cc 100644 --- a/embark-ui/src/components/Blocks.js +++ b/embark-ui/src/components/Blocks.js @@ -11,7 +11,7 @@ const Blocks = ({blocks, showLoadMore, loadMore}) => ( -

Blocks

+

Blocks

{blocks.map(block => ( diff --git a/embark-ui/src/components/ExplorerDashboardLayout.js b/embark-ui/src/components/ExplorerDashboardLayout.js index 4dcb3cf3d..e510c1de9 100644 --- a/embark-ui/src/components/ExplorerDashboardLayout.js +++ b/embark-ui/src/components/ExplorerDashboardLayout.js @@ -12,7 +12,7 @@ import './Explorer.css'; const ExplorerDashboardLayout = () => ( - + diff --git a/embark-ui/src/components/Transactions.js b/embark-ui/src/components/Transactions.js index 643bf3419..1e8dc643d 100644 --- a/embark-ui/src/components/Transactions.js +++ b/embark-ui/src/components/Transactions.js @@ -11,7 +11,7 @@ const Transactions = ({transactions, showLoadMore, loadMore}) => ( -

Transactions

+

Transactions

{transactions.map(transaction => ( @@ -41,7 +41,7 @@ const Transactions = ({transactions, showLoadMore, loadMore}) => (
))} - {showLoadMore && loadMore()} />} + {showLoadMore && loadMore()}/>}
From ee3d23567e4471f80dbe37a30daeb4da214ae808 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Wed, 24 Oct 2018 10:54:25 -0400 Subject: [PATCH 5/8] remove useless align class --- embark-ui/src/components/Blocks.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/embark-ui/src/components/Blocks.js b/embark-ui/src/components/Blocks.js index ca63a13cc..5ec7e93dc 100644 --- a/embark-ui/src/components/Blocks.js +++ b/embark-ui/src/components/Blocks.js @@ -17,7 +17,7 @@ const Blocks = ({blocks, showLoadMore, loadMore}) => ( {blocks.map(block => (
Block  - + {block.number} From 54ee9417dbf5dc5f4d5568191669cb6128c6f8b4 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Wed, 24 Oct 2018 10:56:36 -0400 Subject: [PATCH 6/8] remove unused references --- embark-ui/src/components/CardTitleIdenticon.js | 5 ++++- embark-ui/src/components/ContractDetail.js | 4 +--- embark-ui/src/containers/TransactionsContainer.js | 2 -- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/embark-ui/src/components/CardTitleIdenticon.js b/embark-ui/src/components/CardTitleIdenticon.js index 0febddc1b..f0576ff3c 100644 --- a/embark-ui/src/components/CardTitleIdenticon.js +++ b/embark-ui/src/components/CardTitleIdenticon.js @@ -11,7 +11,10 @@ const CardTitleIdenticon = ({id, children}) => ( CardTitleIdenticon.propTypes = { id: PropTypes.string, - children: PropTypes.object + children: PropTypes.oneOfType([ + PropTypes.object, + PropTypes.array + ]) }; export default CardTitleIdenticon; diff --git a/embark-ui/src/components/ContractDetail.js b/embark-ui/src/components/ContractDetail.js index 5797afa7c..da37a73ad 100644 --- a/embark-ui/src/components/ContractDetail.js +++ b/embark-ui/src/components/ContractDetail.js @@ -1,12 +1,10 @@ import PropTypes from "prop-types"; import React from 'react'; import ReactJson from "react-json-view"; -import {Row, Col, Table} from "reactstrap"; -import {formatContractForDisplay} from '../utils/presentation'; +import {Row, Col} from "reactstrap"; import CopyButton from './CopyButton'; const ContractDetail = ({contract}) => { - const contractDisplay = formatContractForDisplay(contract); return ( diff --git a/embark-ui/src/containers/TransactionsContainer.js b/embark-ui/src/containers/TransactionsContainer.js index ef6c107e4..861709b1c 100644 --- a/embark-ui/src/containers/TransactionsContainer.js +++ b/embark-ui/src/containers/TransactionsContainer.js @@ -3,8 +3,6 @@ import {connect} from 'react-redux'; import PropTypes from 'prop-types'; import {transactions as transactionsAction, initBlockHeader, stopBlockHeader} from '../actions'; -import Blocks from "../components/Blocks"; -import LoadMore from "../components/LoadMore"; import Transactions from '../components/Transactions'; import DataWrapper from "../components/DataWrapper"; import {getTransactions} from "../reducers/selectors"; From e456a76d1926c448cb7ee96569bd7b947b9da0cd Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Wed, 24 Oct 2018 11:01:03 -0400 Subject: [PATCH 7/8] better position columns --- embark-ui/src/components/Transactions.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/embark-ui/src/components/Transactions.js b/embark-ui/src/components/Transactions.js index 1e8dc643d..bfc09db7d 100644 --- a/embark-ui/src/components/Transactions.js +++ b/embark-ui/src/components/Transactions.js @@ -22,19 +22,19 @@ const Transactions = ({transactions, showLoadMore, loadMore}) => ( - + Block number
{transaction.blockNumber}
- + From
{transaction.from}
- + To
{transaction.to}
- + Type
{transaction.to ? "Contract Call" : "Contract Creation"}
From 991066a1f58a11a99ce107e9547e0a5f95dd9ca1 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Wed, 24 Oct 2018 11:54:21 -0400 Subject: [PATCH 8/8] use bootstrap border utility --- embark-ui/src/components/Accounts.js | 2 +- embark-ui/src/components/Blocks.js | 2 +- embark-ui/src/components/Explorer.css | 10 +++++----- embark-ui/src/components/Transactions.js | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/embark-ui/src/components/Accounts.js b/embark-ui/src/components/Accounts.js index e153c48b9..36aea7be3 100644 --- a/embark-ui/src/components/Accounts.js +++ b/embark-ui/src/components/Accounts.js @@ -14,7 +14,7 @@ const Accounts = ({accounts}) => ( {accounts.map(account => ( -
+
Account  {account.address} diff --git a/embark-ui/src/components/Blocks.js b/embark-ui/src/components/Blocks.js index 5ec7e93dc..ba27fbd0f 100644 --- a/embark-ui/src/components/Blocks.js +++ b/embark-ui/src/components/Blocks.js @@ -15,7 +15,7 @@ const Blocks = ({blocks, showLoadMore, loadMore}) => ( {blocks.map(block => ( -
+
Block  {block.number} diff --git a/embark-ui/src/components/Explorer.css b/embark-ui/src/components/Explorer.css index 352436539..80964c1f8 100644 --- a/embark-ui/src/components/Explorer.css +++ b/embark-ui/src/components/Explorer.css @@ -1,11 +1,11 @@ +.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: 1px solid #c8ced3; -} - -.dark-theme .explorer-row { - border-top-color: #23282c; + border-top-width: 1px !important; } .explorer-row .text-truncate { diff --git a/embark-ui/src/components/Transactions.js b/embark-ui/src/components/Transactions.js index bfc09db7d..1a80121fe 100644 --- a/embark-ui/src/components/Transactions.js +++ b/embark-ui/src/components/Transactions.js @@ -15,7 +15,7 @@ const Transactions = ({transactions, showLoadMore, loadMore}) => ( {transactions.map(transaction => ( -
+
Transaction  {transaction.hash}