mirror of https://github.com/embarklabs/embark.git
Merge pull request #1007 from embark-framework/fix/make-linter-happy
Make linter happy 2019
This commit is contained in:
commit
54dc34ef15
|
@ -52,6 +52,12 @@ const LayoutContract = ({contract, children, cardTitle}) => (
|
|||
</Card>
|
||||
);
|
||||
|
||||
LayoutContract.propTypes = {
|
||||
contract: PropTypes.object,
|
||||
children: PropTypes.array,
|
||||
cardTitle: PropTypes.string
|
||||
};
|
||||
|
||||
const DeploymentResult = ({deployment}) => {
|
||||
if (deployment.running) {
|
||||
return <p>Deployment is in progress <FontAwesomeIcon className="ml-1" name="spinner" spin/></p>;
|
||||
|
@ -73,6 +79,10 @@ const DeploymentResult = ({deployment}) => {
|
|||
);
|
||||
};
|
||||
|
||||
DeploymentResult.propTypes = {
|
||||
deployment: PropTypes.object
|
||||
}
|
||||
|
||||
const GasEstimateResult = ({gasEstimate}) => {
|
||||
if (gasEstimate.running) {
|
||||
return <p>Gas Estimation is in progresss <FontAwesomeIcon className="ml-1" name="spinner" spin/></p>;
|
||||
|
@ -85,6 +95,10 @@ const GasEstimateResult = ({gasEstimate}) => {
|
|||
return <p className="text-success">Gas Estimation succeed: {gasEstimate.gas}</p>;
|
||||
};
|
||||
|
||||
GasEstimateResult.propTypes = {
|
||||
gasEstimate: PropTypes.object
|
||||
};
|
||||
|
||||
class Web3Contract extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
@ -158,11 +172,20 @@ class Web3Contract extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
Web3Contract.propTypes = {
|
||||
contract: PropTypes.object,
|
||||
web3: PropTypes.object,
|
||||
web3EstimateGas: PropTypes.func,
|
||||
web3Deploy: PropTypes.func,
|
||||
gasEstimate: PropTypes.object,
|
||||
deployment: PropTypes.object
|
||||
};
|
||||
|
||||
const EmbarkContract = ({contract, toggleContractOverview}) => (
|
||||
<LayoutContract contract={contract} cardTitle={
|
||||
<React.Fragment>
|
||||
<a href='#toggleContract' onClick={() => toggleContractOverview(contract)}>{contract.className}</a>
|
||||
<span>{contract.address && `deployed at ${contract.address}` || "not deployed"}</span>
|
||||
<span>{(contract.address && `deployed at ${contract.address}`) || 'not deployed'}</span>
|
||||
</React.Fragment>
|
||||
}>
|
||||
{contract.address && <p><strong>Arguments:</strong> {JSON.stringify(contract.args)}</p>}
|
||||
|
@ -179,6 +202,11 @@ const EmbarkContract = ({contract, toggleContractOverview}) => (
|
|||
</LayoutContract>
|
||||
);
|
||||
|
||||
EmbarkContract.propTypes = {
|
||||
contract: PropTypes.object,
|
||||
toggleContractOverview: PropTypes.func
|
||||
};
|
||||
|
||||
const ContractsHeader = ({deploymentPipeline, updateDeploymentPipeline}) => (
|
||||
<Row>
|
||||
<div className="ml-auto mr-5">
|
||||
|
@ -215,6 +243,11 @@ const ContractsHeader = ({deploymentPipeline, updateDeploymentPipeline}) => (
|
|||
</Row>
|
||||
);
|
||||
|
||||
ContractsHeader.propTypes = {
|
||||
deploymentPipeline: PropTypes.object,
|
||||
updateDeploymentPipeline: PropTypes.func
|
||||
};
|
||||
|
||||
const Contract = ({web3, contract, deploymentPipeline, web3Deploy, web3EstimateGas, web3Deployments, web3GasEstimates, toggleContractOverview}) => {
|
||||
const deployment = web3Deployments[contract.className];
|
||||
const gasEstimate = web3GasEstimates[contract.className];
|
||||
|
@ -233,6 +266,17 @@ const Contract = ({web3, contract, deploymentPipeline, web3Deploy, web3EstimateG
|
|||
}
|
||||
};
|
||||
|
||||
Contract.propTypes = {
|
||||
contract: PropTypes.object,
|
||||
deploymentPipeline: PropTypes.object,
|
||||
toggleContractOverview: PropTypes.func,
|
||||
web3: PropTypes.object,
|
||||
web3Deploy: PropTypes.func,
|
||||
web3Deployments: PropTypes.object,
|
||||
web3EstimateGas: PropTypes.func,
|
||||
web3GasEstimates: PropTypes.object
|
||||
};
|
||||
|
||||
class ContractsDeployment extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
|
||||
const Description = ({label, value}) => (
|
||||
|
@ -7,4 +8,9 @@ const Description = ({label, value}) => (
|
|||
</React.Fragment>
|
||||
);
|
||||
|
||||
export default Description
|
||||
Description.propTypes = {
|
||||
label: PropTypes.string,
|
||||
value: PropTypes.string
|
||||
};
|
||||
|
||||
export default Description
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
import {
|
||||
Card,
|
||||
|
@ -13,7 +14,6 @@ import {
|
|||
} from 'reactstrap';
|
||||
|
||||
class SignAndVerify extends React.Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
|
@ -97,4 +97,16 @@ class SignAndVerify extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
SignAndVerify.propTypes = {
|
||||
accounts: PropTypes.array,
|
||||
signMessage: PropTypes.function,
|
||||
signatureError: PropTypes.string,
|
||||
signaturePending: PropTypes.function,
|
||||
signedMessage: PropTypes.string,
|
||||
verificationError: PropTypes.string,
|
||||
verificationPending: PropTypes.boolean,
|
||||
verifiedAddress: PropTypes.string,
|
||||
verifyMessage: PropTypes.function
|
||||
};
|
||||
|
||||
export default SignAndVerify;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
import {withRouter} from 'react-router-dom';
|
||||
import {
|
||||
|
@ -65,4 +66,10 @@ class TransactionDecoder extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
TransactionDecoder.propTypes = {
|
||||
history: PropTypes.array,
|
||||
transaction: PropTypes.object,
|
||||
transactionHash: PropTypes.string
|
||||
};
|
||||
|
||||
export default withRouter(TransactionDecoder);
|
||||
|
|
|
@ -12,7 +12,7 @@ const propTypes = {
|
|||
variant: PropTypes.string,
|
||||
children: PropTypes.node,
|
||||
className: PropTypes.string,
|
||||
cssModule: PropTypes.object,
|
||||
cssModule: PropTypes.object
|
||||
};
|
||||
|
||||
const defaultProps = {
|
||||
|
@ -21,12 +21,11 @@ const defaultProps = {
|
|||
icon: 'fa fa-cogs',
|
||||
color: 'primary',
|
||||
variant: '0',
|
||||
link: '#',
|
||||
};
|
||||
|
||||
class Widget02 extends Component {
|
||||
render() {
|
||||
const { className, cssModule, header, mainText, icon, color, footer, link, children, variant, ...attributes } = this.props;
|
||||
const { className, cssModule, header, mainText, icon, color, children, variant, ...attributes } = this.props;
|
||||
|
||||
// demo purposes only
|
||||
const padding = (variant === '0' ? { card: 'p-3', icon: 'p-3', lead: 'mt-2' } : (variant === '1' ? {
|
||||
|
|
|
@ -137,6 +137,7 @@ AppContainer.propTypes = {
|
|||
theme: PropTypes.string,
|
||||
changeTheme: PropTypes.func,
|
||||
fetchTheme: PropTypes.func,
|
||||
history: PropTypes.instanceOf(History)
|
||||
};
|
||||
|
||||
function mapStateToProps(state) {
|
||||
|
|
|
@ -2,8 +2,8 @@ import React, {Component} from 'react';
|
|||
import {connect} from 'react-redux';
|
||||
import PropTypes from 'prop-types';
|
||||
import {
|
||||
contracts as contractsAction,
|
||||
web3Deploy as web3DeployAction,
|
||||
contracts as contractsAction,
|
||||
web3Deploy as web3DeployAction,
|
||||
web3EstimateGas as web3EstimateGasAction,
|
||||
updateDeploymentPipeline} from "../actions";
|
||||
|
||||
|
@ -19,8 +19,8 @@ class DeploymentContainer extends Component {
|
|||
render() {
|
||||
return (
|
||||
<DataWrapper shouldRender={this.props.contracts.length > 0} {...this.props} render={() => (
|
||||
<ContractsDeployment contracts={this.props.contracts}
|
||||
deploymentPipeline={this.props.deploymentPipeline}
|
||||
<ContractsDeployment contracts={this.props.contracts}
|
||||
deploymentPipeline={this.props.deploymentPipeline}
|
||||
web3={this.props.web3}
|
||||
web3Deploy={this.props.web3Deploy}
|
||||
web3EstimateGas={this.props.web3EstimateGas}
|
||||
|
@ -39,19 +39,21 @@ function mapStateToProps(state) {
|
|||
web3: getWeb3(state),
|
||||
web3Deployments: getWeb3Deployments(state),
|
||||
web3GasEstimates: getWeb3GasEstimates(state),
|
||||
error: state.errorMessage,
|
||||
error: state.errorMessage,
|
||||
loading: state.loading
|
||||
};
|
||||
}
|
||||
|
||||
DeploymentContainer.propTypes = {
|
||||
web3: PropTypes.object,
|
||||
web3Deployments: PropTypes.object,
|
||||
web3GasEstimates: PropTypes.object,
|
||||
contracts: PropTypes.array,
|
||||
deploymentPipeline: PropTypes.object,
|
||||
fetchContracts: PropTypes.func,
|
||||
updateDeploymentPipeline: PropTypes.func,
|
||||
web3: PropTypes.object,
|
||||
web3Deploy: PropTypes.func,
|
||||
web3Deployments: PropTypes.object,
|
||||
web3EstimateGas: PropTypes.func,
|
||||
web3GasEstimates: PropTypes.object,
|
||||
};
|
||||
|
||||
export default connect(
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import PropTypes from 'prop-types';
|
||||
import React, { Component } from 'react';
|
||||
import {connect} from 'react-redux';
|
||||
import SignAndVerify from '../components/SignAndVerify';
|
||||
|
@ -40,6 +41,19 @@ class SignAndVerifyContainer extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
SignAndVerifyContainer.propTypes = {
|
||||
accounts: PropTypes.array,
|
||||
fetchAccounts: PropTypes.func,
|
||||
signMessage: PropTypes.func,
|
||||
signatureError: PropTypes.string,
|
||||
signaturePending: PropTypes.boolean,
|
||||
signedMessage: PropTypes.string,
|
||||
verificationError: PropTypes.string,
|
||||
verificationPending: PropTypes.boolean,
|
||||
verifiedAddress: PropTypes.string,
|
||||
verifyMessage: PropTypes.func
|
||||
};
|
||||
|
||||
function mapStateToProps(state) {
|
||||
return {
|
||||
accounts: getAccounts(state),
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import PropTypes from 'prop-types';
|
||||
import React, { Component } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import qs from 'qs';
|
||||
|
@ -14,7 +15,6 @@ const getQueryParams = (props) => {
|
|||
};
|
||||
|
||||
class TransactionDecoderContainer extends Component {
|
||||
|
||||
componentDidMount() {
|
||||
const { hash } = getQueryParams(this.props);
|
||||
if (hash) {
|
||||
|
@ -43,6 +43,11 @@ class TransactionDecoderContainer extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
TransactionDecoderContainer.propTypes = {
|
||||
fetchTransaction: PropTypes.func,
|
||||
transaction: PropTypes.object
|
||||
};
|
||||
|
||||
function mapStateToProps(state, props) {
|
||||
return {
|
||||
transaction: getTransaction(state, getQueryParams(props).hash),
|
||||
|
|
Loading…
Reference in New Issue