mirror of https://github.com/embarklabs/embark.git
conflict in transactions
This commit is contained in:
parent
2ed2f9388b
commit
bc0a89fd6d
|
@ -1,9 +1,17 @@
|
||||||
|
import PropTypes from "prop-types";
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {CardTitle} from 'reactstrap';
|
import {CardTitle} from 'reactstrap';
|
||||||
import Blockies from 'react-blockies';
|
import Blockies from 'react-blockies';
|
||||||
|
|
||||||
const CardTitleIdenticon = ({id, children}) => (
|
const CardTitleIdenticon = ({id, children}) => (
|
||||||
<CardTitle><Blockies seed={id} className="rounded"/><span className="ml-2 align-top">{children}</span></CardTitle>
|
<CardTitle>
|
||||||
)
|
<Blockies seed={id} className="rounded"/><span className="ml-2 align-top text-truncate">{children}</span>
|
||||||
|
</CardTitle>
|
||||||
|
);
|
||||||
|
|
||||||
export default CardTitleIdenticon
|
CardTitleIdenticon.propTypes = {
|
||||||
|
id: PropTypes.string,
|
||||||
|
children: PropTypes.object
|
||||||
|
};
|
||||||
|
|
||||||
|
export default CardTitleIdenticon;
|
||||||
|
|
|
@ -7,3 +7,8 @@
|
||||||
.dark-theme .explorer-row {
|
.dark-theme .explorer-row {
|
||||||
border-bottom-color: #23282c;
|
border-bottom-color: #23282c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.explorer-row .text-truncate {
|
||||||
|
width: 90%;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
|
@ -4,48 +4,54 @@ import {Row, Col, Card, CardHeader, CardBody} from 'reactstrap';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import CardTitleIdenticon from './CardTitleIdenticon';
|
import CardTitleIdenticon from './CardTitleIdenticon';
|
||||||
|
import LoadMore from "./LoadMore";
|
||||||
|
|
||||||
const Transactions = ({transactions}) => (
|
const Transactions = ({transactions, showLoadMore, loadMore}) => (
|
||||||
<Row>
|
<Row>
|
||||||
<Col>
|
<Col>
|
||||||
<h1>Transactions</h1>
|
<Card>
|
||||||
{transactions.map(transaction => (
|
<CardHeader>
|
||||||
<Card key={transaction.hash}>
|
<h1>Transactions</h1>
|
||||||
<CardHeader>
|
</CardHeader>
|
||||||
<CardTitleIdenticon id={transaction.hash}>Transaction
|
<CardBody>
|
||||||
<Link to={`/embark/explorer/transactions/${transaction.hash}`}>
|
{transactions.map(transaction => (
|
||||||
{transaction.hash}
|
<div className="explorer-row" key={transaction.hash}>
|
||||||
</Link>
|
<CardTitleIdenticon id={transaction.hash}>Transaction
|
||||||
</CardTitleIdenticon>
|
<Link to={`/embark/explorer/transactions/${transaction.hash}`}>
|
||||||
</CardHeader>
|
{transaction.hash}
|
||||||
<CardBody>
|
</Link>
|
||||||
<Row>
|
</CardTitleIdenticon>
|
||||||
<Col>
|
<Row>
|
||||||
<strong>Block number</strong>
|
<Col>
|
||||||
<div>{transaction.blockNumber}</div>
|
<strong>Block number</strong>
|
||||||
</Col>
|
<div>{transaction.blockNumber}</div>
|
||||||
<Col>
|
</Col>
|
||||||
<strong>From</strong>
|
<Col>
|
||||||
<div>{transaction.from}</div>
|
<strong>From</strong>
|
||||||
</Col>
|
<div>{transaction.from}</div>
|
||||||
<Col>
|
</Col>
|
||||||
<strong>To</strong>
|
<Col>
|
||||||
<div>{transaction.to}</div>
|
<strong>To</strong>
|
||||||
</Col>
|
<div>{transaction.to}</div>
|
||||||
<Col>
|
</Col>
|
||||||
<strong>Type</strong>
|
<Col>
|
||||||
<div>{transaction.to ? "Contract Call" : "Contract Creation"}</div>
|
<strong>Type</strong>
|
||||||
</Col>
|
<div>{transaction.to ? "Contract Call" : "Contract Creation"}</div>
|
||||||
</Row>
|
</Col>
|
||||||
</CardBody>
|
</Row>
|
||||||
</Card>
|
</div>
|
||||||
))}
|
))}
|
||||||
|
{showLoadMore && <LoadMore loadMore={() => loadMore()} />}
|
||||||
|
</CardBody>
|
||||||
|
</Card>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
);
|
);
|
||||||
|
|
||||||
Transactions.propTypes = {
|
Transactions.propTypes = {
|
||||||
transactions: PropTypes.arrayOf(PropTypes.object)
|
transactions: PropTypes.arrayOf(PropTypes.object),
|
||||||
|
showLoadMore: PropTypes.bool,
|
||||||
|
loadMore: PropTypes.func
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Transactions;
|
export default Transactions;
|
||||||
|
|
|
@ -3,6 +3,7 @@ import {connect} from 'react-redux';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import {transactions as transactionsAction, initBlockHeader, stopBlockHeader} from '../actions';
|
import {transactions as transactionsAction, initBlockHeader, stopBlockHeader} from '../actions';
|
||||||
|
import Blocks from "../components/Blocks";
|
||||||
import LoadMore from "../components/LoadMore";
|
import LoadMore from "../components/LoadMore";
|
||||||
import Transactions from '../components/Transactions';
|
import Transactions from '../components/Transactions';
|
||||||
import DataWrapper from "../components/DataWrapper";
|
import DataWrapper from "../components/DataWrapper";
|
||||||
|
@ -34,9 +35,9 @@ class TransactionsContainer extends Component {
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<DataWrapper shouldRender={this.props.transactions.length > 0} {...this.props} render={({transactions}) => (
|
<DataWrapper shouldRender={this.props.transactions.length > 0} {...this.props} render={({transactions}) => (
|
||||||
<Transactions transactions={transactions} />
|
<Transactions transactions={transactions}
|
||||||
|
showLoadMore={(this.loadMoreFrom() >= 0)} loadMore={() => this.loadMore()} />
|
||||||
)} />
|
)} />
|
||||||
{(this.loadMoreFrom() > 0) ? <LoadMore loadMore={() => this.loadMore()} /> : <React.Fragment />}
|
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue