From ff0d7d20dfb667f0695fbdfa62406c2d2f6d427b Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Wed, 17 Oct 2018 13:24:57 +0100 Subject: [PATCH] Better format element of explorer --- embark-ui/src/components/Account.js | 10 +++++++--- embark-ui/src/components/Block.js | 23 +++++++++++++++++++++-- embark-ui/src/components/Description.js | 10 ++++++++++ embark-ui/src/components/Logs.css | 16 ---------------- embark-ui/src/components/Transaction.js | 19 ++++++++++++------- 5 files changed, 50 insertions(+), 28 deletions(-) create mode 100644 embark-ui/src/components/Description.js diff --git a/embark-ui/src/components/Account.js b/embark-ui/src/components/Account.js index 77cff7343..a8f6353b0 100644 --- a/embark-ui/src/components/Account.js +++ b/embark-ui/src/components/Account.js @@ -2,12 +2,16 @@ import React from 'react'; import {Row, Col} from 'reactstrap'; import PropTypes from 'prop-types'; +import Description from './Description'; + const Account = ({account}) => ( -

{account.address}

-

Balance: {account.balance}

-

Tx count: {account.transactionCount}

+

Account {account.address}

+
+ + +
); diff --git a/embark-ui/src/components/Block.js b/embark-ui/src/components/Block.js index 785dc1599..0ab326395 100644 --- a/embark-ui/src/components/Block.js +++ b/embark-ui/src/components/Block.js @@ -2,12 +2,31 @@ import React from 'react'; import {Row, Col} from 'reactstrap'; import PropTypes from 'prop-types'; +import Description from './Description'; + const Block = ({block}) => (

Block {block.number}

-

Timestamp: {block.timestamp}

-

Gas used: {block.gasUsed}

+
+ + + + + + + + + + + + + + + + + +
); diff --git a/embark-ui/src/components/Description.js b/embark-ui/src/components/Description.js new file mode 100644 index 000000000..9ba8cec4b --- /dev/null +++ b/embark-ui/src/components/Description.js @@ -0,0 +1,10 @@ +import React from 'react'; + +const Description = ({label, value}) => ( + +
{label}
+
{value}
+
+); + +export default Description \ No newline at end of file diff --git a/embark-ui/src/components/Logs.css b/embark-ui/src/components/Logs.css index 7843e5c26..57c1333db 100644 --- a/embark-ui/src/components/Logs.css +++ b/embark-ui/src/components/Logs.css @@ -8,20 +8,4 @@ border-radius: 8px; max-height: 350px; overflow: auto; -} - -.logs .error { - color: #dc3546; -} - -.logs .warn { - color: #fec107; -} - -.logs .debug { - color: #b7c1cc; -} - -.logs .trace { - color: #8f98a2; } \ No newline at end of file diff --git a/embark-ui/src/components/Transaction.js b/embark-ui/src/components/Transaction.js index fbcd70ed6..3a2e776ec 100644 --- a/embark-ui/src/components/Transaction.js +++ b/embark-ui/src/components/Transaction.js @@ -3,17 +3,22 @@ import {Link} from 'react-router-dom'; import {Row, Col} from 'reactstrap'; import PropTypes from 'prop-types'; +import Description from './Description'; + const Transaction = ({transaction}) => (

Transaction {transaction.hash}

-

Block: {transaction.blockNumber}

-

From: {transaction.from}

-

To: {transaction.to}

-

Input: {transaction.input}

-

Gas: {transaction.gas}

-

Gas Price: {transaction.gasPrice}

-

Nonce: {transaction.nonce}

+
+ {transaction.blockNumber}} /> + + + + + + + +
);