Merge pull request #167 from status-im/more-style-fixes

More style fixes
This commit is contained in:
Iuri Matias 2018-10-25 15:43:49 -04:00 committed by GitHub
commit 2490c76242
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 37 additions and 30 deletions

View File

@ -13,7 +13,8 @@ CardTitleIdenticon.propTypes = {
id: PropTypes.string, id: PropTypes.string,
children: PropTypes.oneOfType([ children: PropTypes.oneOfType([
PropTypes.object, PropTypes.object,
PropTypes.array PropTypes.array,
PropTypes.string
]) ])
}; };

View File

@ -44,7 +44,7 @@ class Communication extends Component {
render() { render() {
return ( return (
<Row className="mt-3 justify-content-md-center"> <Row className="justify-content-md-center">
<Col xs="12" sm="9" lg="9"> <Col xs="12" sm="9" lg="9">
<Card> <Card>
<CardHeader> <CardHeader>

View File

@ -95,8 +95,8 @@ class ContractFunction extends Component {
render() { render() {
return ( return (
<Card className="contract-function-container"> <Card className="contract-function-container">
<CardHeader> <CardHeader className="collapsable" onClick={() => this.toggleFunction()}>
<CardTitle className="collapsable" onClick={() => this.toggleFunction()}> <CardTitle>
{ContractFunction.isPureCall(this.props.method) && {ContractFunction.isPureCall(this.props.method) &&
<button className="btn btn-warning btn-sm float-right" onClick={(e) => this.handleCall(e)}>call</button> <button className="btn btn-warning btn-sm float-right" onClick={(e) => this.handleCall(e)}>call</button>
} }

View File

@ -180,7 +180,7 @@ const EmbarkContract = ({contract, toggleContractOverview}) => (
); );
const ContractsHeader = ({deploymentPipeline, updateDeploymentPipeline}) => ( const ContractsHeader = ({deploymentPipeline, updateDeploymentPipeline}) => (
<Row className="mt-3"> <Row>
<div className="ml-auto mr-5"> <div className="ml-auto mr-5">
<FormGroup row> <FormGroup row>
<span className="mr-2">Deploy using</span> <span className="mr-2">Deploy using</span>

View File

@ -35,7 +35,7 @@ class Converter extends React.Component {
render() { render() {
return( return(
<Row className="mt-3 justify-content-md-center"> <Row className="justify-content-md-center">
<Col xs="12" sm="9" lg="9"> <Col xs="12" sm="9" lg="9">
<Card> <Card>
<CardHeader> <CardHeader>

View File

@ -1,23 +1,23 @@
.explorer-row { #root .explorer-row {
border-top-width: 0 !important; /*Bootstrap uses important, so we need to override it*/ border-top-width: 0 !important; /*Bootstrap uses important, so we need to override it*/
} }
.explorer-overview .card-body { #root .explorer-overview .card-body {
overflow: hidden; overflow: hidden;
} }
.explorer-row + .explorer-row { #root .explorer-row + .explorer-row {
margin-top: 5px; margin-top: 5px;
padding-top: 20px; padding-top: 20px;
border-top-width: 1px !important; border-top-width: 1px !important;
} }
.explorer-row .text-truncate { #root .explorer-row .text-truncate {
width: 90%; width: 90%;
display: inline-block; display: inline-block;
} }
.explorer-row .text-truncate { #root .explorer-row .text-truncate {
width: 90%; width: 90%;
display: inline-block; display: inline-block;
} }

View File

@ -12,7 +12,7 @@ import './Explorer.css';
const ExplorerDashboardLayout = () => ( const ExplorerDashboardLayout = () => (
<div className="explorer-overview"> <div className="explorer-overview">
<Row className="mt-4"> <Row>
<Col> <Col>
<AccountsContainer /> <AccountsContainer />
</Col> </Col>

View File

@ -40,7 +40,7 @@ const SIDEBAR_NAV_ITEMS = {
{url: "/embark/explorer/accounts", icon: "fa fa-users", name: "Accounts"}, {url: "/embark/explorer/accounts", icon: "fa fa-users", name: "Accounts"},
{url: "/embark/explorer/blocks", icon: "fa fa-stop", name: "Blocks"}, {url: "/embark/explorer/blocks", icon: "fa fa-stop", name: "Blocks"},
{url: "/embark/explorer/contracts", icon: "fa fa-file-code-o", name: "Contracts"}, {url: "/embark/explorer/contracts", icon: "fa fa-file-code-o", name: "Contracts"},
{url: "/embark/explorer/transactions", icon: "fa fa-tree", name: "Transactions"} {url: "/embark/explorer/transactions", icon: "fa fa-exchange", name: "Transactions"}
]}, ]},
"/embark/utilities/": {items: [ "/embark/utilities/": {items: [
{url: "/embark/utilities/converter", icon: "fa fa-plug", name: "Converter"}, {url: "/embark/utilities/converter", icon: "fa fa-plug", name: "Converter"},
@ -225,7 +225,7 @@ class Layout extends React.Component {
{searchResult.error} {searchResult.error}
</Alert> </Alert>
<Container fluid className="h-100"> <Container fluid className="h-100 pt-4">
{children} {children}
</Container> </Container>
</main> </main>

View File

@ -29,7 +29,7 @@ Process.propTypes = {
}; };
const Processes = ({processes}) => ( const Processes = ({processes}) => (
<Row className="mt-3"> <Row>
{processes.map((process) => <Process key={process.name} process={process} />)} {processes.map((process) => <Process key={process.name} process={process} />)}
</Row> </Row>
); );

View File

@ -19,7 +19,7 @@ class SignAndVerify extends React.Component {
this.state = { this.state = {
selectedAccount: this.props.accounts[0].address, selectedAccount: this.props.accounts[0].address,
messageToSign: '', messageToSign: '',
messageToVerify: '', messageToVerify: ''
}; };
} }
@ -40,7 +40,7 @@ class SignAndVerify extends React.Component {
render() { render() {
return ( return (
<Row className="mt-3 justify-content-md-center"> <Row className="justify-content-md-center">
<Col xs="12" sm="9" lg="6"> <Col xs="12" sm="9" lg="6">
<Card> <Card>
<CardHeader> <CardHeader>

View File

@ -1,4 +1,5 @@
.editor--grid { .editor--grid {
margin-left: -30px !important; margin-left: -30px !important;
margin-right: -30px !important; margin-right: -30px !important;
margin-top: -1.5rem !important;
} }

View File

@ -12,7 +12,7 @@ class EnsContainer extends Component {
showEns() { showEns() {
return ( return (
<Row className="mt-3 justify-content-md-center"> <Row className="justify-content-md-center">
<Col xs="12" sm="9" lg="6"> <Col xs="12" sm="9" lg="6">
<EnsLookup lookup={this.props.lookup} ensRecords={this.props.ensRecords}/> <EnsLookup lookup={this.props.lookup} ensRecords={this.props.ensRecords}/>
<EnsResolve resolve={this.props.resolve} ensRecords={this.props.ensRecords}/> <EnsResolve resolve={this.props.resolve} ensRecords={this.props.ensRecords}/>

View File

@ -35,11 +35,11 @@ class HomeContainer extends Component {
} }
isEmbark() { isEmbark() {
return this.state.activeProcess === EMBARK_PROCESS_NAME return this.state.activeProcess === EMBARK_PROCESS_NAME;
} }
updateTab(processName = EMBARK_PROCESS_NAME) { updateTab(processName = EMBARK_PROCESS_NAME) {
this.props.stopProcessLogs(this.state.activeProcess) this.props.stopProcessLogs(this.state.activeProcess);
this.props.fetchProcessLogs(processName, LOG_LIMIT); this.props.fetchProcessLogs(processName, LOG_LIMIT);
this.props.listenToProcessLogs(processName); this.props.listenToProcessLogs(processName);
@ -93,7 +93,13 @@ HomeContainer.propTypes = {
postCommand: PropTypes.func, postCommand: PropTypes.func,
postCommandSuggestions: PropTypes.func, postCommandSuggestions: PropTypes.func,
error: PropTypes.string, error: PropTypes.string,
loading: PropTypes.bool loading: PropTypes.bool,
stopProcessLogs: PropTypes.func,
fetchProcessLogs: PropTypes.func,
listenToProcessLogs: PropTypes.func,
fetchContracts: PropTypes.func,
services: PropTypes.array,
contracts: PropTypes.array
}; };
function mapStateToProps(state) { function mapStateToProps(state) {

View File

@ -11,7 +11,7 @@ const getQueryParams = (props) => {
return qs.parse(props.location.search, { return qs.parse(props.location.search, {
ignoreQueryPrefix: true ignoreQueryPrefix: true
}); });
} };
class TransactionDecoderContainer extends Component { class TransactionDecoderContainer extends Component {
@ -33,7 +33,7 @@ class TransactionDecoderContainer extends Component {
render() { render() {
return ( return (
<Row className="mt-3"> <Row>
<Col> <Col>
<TransactionDecoder transaction={this.props.transaction} <TransactionDecoder transaction={this.props.transaction}
transactionHash={getQueryParams(this.props).hash}/> transactionHash={getQueryParams(this.props).hash}/>

View File

@ -33,7 +33,7 @@ export function getTransactionsByAccount(state, address) {
} }
export function getTransactionsByBlock(state, blockNumber) { export function getTransactionsByBlock(state, blockNumber) {
return state.entities.transactions.filter((transaction) => transaction.blockNumber.toString() === blockNumber); return state.entities.transactions.filter((transaction) => transaction.hasOwnProperty('blockNumber') && transaction.blockNumber.toString() === blockNumber);
} }
export function getBlocks(state) { export function getBlocks(state) {

View File

@ -1,7 +1,6 @@
require('colors'); require('colors');
let fs = require('./fs.js'); let fs = require('./fs.js');
const date = require('date-and-time'); const date = require('date-and-time');
const constants = require('../constants');
const DATE_FORMAT = 'YYYY-MM-DD HH:mm:ss:SSS'; const DATE_FORMAT = 'YYYY-MM-DD HH:mm:ss:SSS';
const LOG_REGEX = new RegExp(/\[(\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d:\d\d\d)\] (?:\[(\w*)\]:?)?\s?\s?(.*)/gmi); const LOG_REGEX = new RegExp(/\[(\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d:\d\d\d)\] (?:\[(\w*)\]:?)?\s?\s?(.*)/gmi);
@ -91,7 +90,7 @@ Logger.prototype.error = function () {
return; return;
} }
this.events.emit("log", "error", ...arguments); this.events.emit("log", "error", ...arguments);
this.logFunction(...Array.from(arguments).map(t => {return t ? t.red : t;})); this.logFunction(...Array.from(arguments).map(t => { return t ? t.red : t; }));
this.writeToFile("[error]: ", ...arguments); this.writeToFile("[error]: ", ...arguments);
}; };
@ -100,7 +99,7 @@ Logger.prototype.warn = function () {
return; return;
} }
this.events.emit("log", "warn", ...arguments); this.events.emit("log", "warn", ...arguments);
this.logFunction(...Array.from(arguments).map(t => {return t ? t.yellow : t;})); this.logFunction(...Array.from(arguments).map(t => { return t ? t.yellow : t; }));
this.writeToFile("[warning]: ", ...arguments); this.writeToFile("[warning]: ", ...arguments);
}; };
@ -109,7 +108,7 @@ Logger.prototype.info = function () {
return; return;
} }
this.events.emit("log", "info", ...arguments); this.events.emit("log", "info", ...arguments);
this.logFunction(...Array.from(arguments).map(t => {return t ? t.green : t;})); this.logFunction(...Array.from(arguments).map(t => { return t ? t.green : t; }));
this.writeToFile("[info]: ", ...arguments); this.writeToFile("[info]: ", ...arguments);
}; };

View File

@ -538,8 +538,8 @@ class BlockchainConnector {
function(next) { function(next) {
async.times(limit, function(n, eachCb) { async.times(limit, function(n, eachCb) {
self.web3.eth.getBlock(from - n, returnTransactionObjects, function(err, block) { self.web3.eth.getBlock(from - n, returnTransactionObjects, function(err, block) {
if (err) { if (err && err.message) {
self.logger.error(err); // FIXME Returns an error because we are too low
return eachCb(); return eachCb();
} }
blocks.push(block); blocks.push(block);