make linter happ-ier

This commit is contained in:
Iuri Matias 2018-08-03 13:08:55 -04:00
parent e45ed0b647
commit ac6198bb9e
5 changed files with 20 additions and 36 deletions

View File

@ -213,8 +213,7 @@
"nonblock-statement-body-position": "error",
"object-curly-newline": "off",
"object-curly-spacing": [
"error",
"never"
"off"
],
"object-property-newline": "off",
"object-shorthand": "off",

View File

@ -30,7 +30,7 @@ const ContractProfile = ({contract}) => (
{content: method.mutability},
{content: `(${method.inputs.map((x) => x.type).join(',')})`},
{content: `(${method.outputs.map((x) => x.type).join(',')})`},
{content: method.gasEstimates},
{content: method.gasEstimates}
]);
})
}
@ -39,7 +39,7 @@ const ContractProfile = ({contract}) => (
</Grid.Col>
</Grid.Row>
</Page.Content>
)
);
export default ContractProfile;

View File

@ -11,16 +11,13 @@ class ContractContainer extends Component {
}
render() {
console.dir("||======>");
console.dir(this.props);
console.dir("||======>");
const { contract } = this.props;
const {contract} = this.props;
if (!contract.data) {
return (
<h1>
<i>Loading contract...</i>
</h1>
)
);
}
if (contract.error) {
@ -28,11 +25,9 @@ class ContractContainer extends Component {
<h1>
<i>Error API...</i>
</h1>
)
);
}
console.dir(contract);
return (
<Contract contract={contract.data} />
);
@ -41,13 +36,13 @@ class ContractContainer extends Component {
function mapStateToProps(state) {
return { contract: state.contract }
}
}:
export default compose(
connect(
mapStateToProps,
{ fetchContract }
{fetchContract}
),
withRouter
)(ContractContainer)
)(ContractContainer);

View File

@ -3,7 +3,7 @@ import { connect } from 'react-redux';
import { compose } from 'redux';
import { fetchContractProfile } from '../actions';
import ContractProfile from '../components/ContractProfile';
import { withRouter } from 'react-router'
import { withRouter } from 'react-router';
class ContractProfileContainer extends Component {
componentWillMount() {
@ -11,9 +11,6 @@ class ContractProfileContainer extends Component {
}
render() {
console.dir("||======>");
console.dir(this.props);
console.dir("||======>");
//const { contract } = this.props;
const contract = this.props.contractProfile;
if (!contract.data) {
@ -21,7 +18,7 @@ class ContractProfileContainer extends Component {
<h1>
<i>Loading contract...</i>
</h1>
)
);
}
if (contract.data.error) {
@ -29,24 +26,17 @@ class ContractProfileContainer extends Component {
<h1>
<i>Error API...</i>
</h1>
)
);
}
console.dir(contract);
return (
<ContractProfile contract={contract.data} />
);
}
};
}
function mapStateToProps(state) {
console.dir("-----------");
console.dir("-----------");
console.dir(state);
console.dir("-----------");
console.dir("-----------");
return { contractProfile: state.contractProfile }
return { contractProfile: state.contractProfile };
}
export default compose(
@ -55,5 +45,5 @@ export default compose(
{ fetchContractProfile }
),
withRouter
)(ContractProfileContainer)
)(ContractProfileContainer);

View File

@ -15,7 +15,7 @@ class ContractsContainer extends Component {
<h1>
<i>Loading contracts...</i>
</h1>
)
);
}
if (contracts.error) {
@ -23,17 +23,17 @@ class ContractsContainer extends Component {
<h1>
<i>Error API...</i>
</h1>
)
);
}
return (
<Contracts contracts={contracts.data} />
);
}
};
}
function mapStateToProps(state) {
return { contracts: state.contracts }
return { contracts: state.contracts };
}
export default connect(
@ -41,5 +41,5 @@ export default connect(
{
fetchContracts
},
)(ContractsContainer)
)(ContractsContainer);