mirror of https://github.com/embarklabs/embark.git
Remove Dead Code
This commit is contained in:
parent
4b2715421d
commit
812a9d0dfa
|
@ -1,58 +0,0 @@
|
|||
import PropTypes from "prop-types";
|
||||
import React from 'react';
|
||||
import {
|
||||
Page,
|
||||
Grid,
|
||||
Card,
|
||||
Table
|
||||
} from "tabler-react";
|
||||
|
||||
const ContractProfile = ({contractProfile}) => (
|
||||
<Page.Content title={contractProfile.name + ' Profile'}>
|
||||
<Grid.Row>
|
||||
<Grid.Col>
|
||||
<Card>
|
||||
<Table
|
||||
responsive
|
||||
cards
|
||||
verticalAlign="center"
|
||||
className="text-nowrap">
|
||||
<Table.Header>
|
||||
<Table.Row>
|
||||
<Table.ColHeader>Function</Table.ColHeader>
|
||||
<Table.ColHeader>Payable</Table.ColHeader>
|
||||
<Table.ColHeader>Mutability</Table.ColHeader>
|
||||
<Table.ColHeader>Inputs</Table.ColHeader>
|
||||
<Table.ColHeader>Outputs</Table.ColHeader>
|
||||
<Table.ColHeader>Gas Estimates</Table.ColHeader>
|
||||
</Table.Row>
|
||||
</Table.Header>
|
||||
<Table.Body>
|
||||
{
|
||||
contractProfile.methods.map((method) => {
|
||||
return (
|
||||
<Table.Row key={method.name}>
|
||||
<Table.Col>{method.name}</Table.Col>
|
||||
<Table.Col>{(method.payable === true).toString()}</Table.Col>
|
||||
<Table.Col>{method.mutability}</Table.Col>
|
||||
<Table.Col>{`(${method.inputs.map((x) => x.type).join(',')})`}</Table.Col>
|
||||
<Table.Col>{`(${method.outputs.map((x) => x.type).join(',')})`}</Table.Col>
|
||||
<Table.Col>{method.gasEstimates}</Table.Col>
|
||||
</Table.Row>
|
||||
);
|
||||
})
|
||||
}
|
||||
</Table.Body>
|
||||
</Table>
|
||||
</Card>
|
||||
</Grid.Col>
|
||||
</Grid.Row>
|
||||
</Page.Content>
|
||||
);
|
||||
|
||||
ContractProfile.propTypes = {
|
||||
contractProfile: PropTypes.object
|
||||
};
|
||||
|
||||
export default ContractProfile;
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
import React, {Component} from 'react';
|
||||
import {connect} from 'react-redux';
|
||||
import PropTypes from 'prop-types';
|
||||
import {withRouter} from 'react-router-dom';
|
||||
|
||||
import {contractProfile as contractProfileAction, contractDeploy as contractDeployAction} from '../actions';
|
||||
import ContractFunctions from '../components/ContractFunctions';
|
||||
import DataWrapper from "../components/DataWrapper";
|
||||
import GasStationContainer from "../containers/GasStationContainer";
|
||||
import {getContractProfile, getContractDeploys} from "../reducers/selectors";
|
||||
|
||||
class ContractDeploymentContainer extends Component {
|
||||
componentDidMount() {
|
||||
this.props.fetchContractProfile(this.props.match.params.contractName);
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<DataWrapper shouldRender={this.props.contractProfile !== undefined}
|
||||
{...this.props}
|
||||
render={({contractProfile, contractDeploys, postContractDeploy}) => (
|
||||
<React.Fragment>
|
||||
<ContractFunctions contractProfile={contractProfile}
|
||||
contractFunctions={contractDeploys}
|
||||
onlyConstructor
|
||||
postContractFunction={postContractDeploy}/>
|
||||
<GasStationContainer/>
|
||||
</React.Fragment>
|
||||
)}/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function mapStateToProps(state, props) {
|
||||
return {
|
||||
contractProfile: getContractProfile(state, props.match.params.contractName),
|
||||
contractDeploys: getContractDeploys(state, props.match.params.contractName),
|
||||
error: state.errorMessage,
|
||||
loading: state.loading
|
||||
};
|
||||
}
|
||||
|
||||
ContractDeploymentContainer.propTypes = {
|
||||
match: PropTypes.object,
|
||||
contractProfile: PropTypes.object,
|
||||
contractFunctions: PropTypes.arrayOf(PropTypes.object),
|
||||
postContractDeploy: PropTypes.func,
|
||||
fetchContractProfile: PropTypes.func,
|
||||
error: PropTypes.string
|
||||
};
|
||||
|
||||
export default withRouter(connect(
|
||||
mapStateToProps,
|
||||
{
|
||||
fetchContractProfile: contractProfileAction.request,
|
||||
postContractDeploy: contractDeployAction.post
|
||||
}
|
||||
)(ContractDeploymentContainer));
|
|
@ -1,45 +0,0 @@
|
|||
import React, {Component} from 'react';
|
||||
import {connect} from 'react-redux';
|
||||
import PropTypes from 'prop-types';
|
||||
import {withRouter} from 'react-router-dom';
|
||||
|
||||
import {contractProfile as contractProfileAction} from '../actions';
|
||||
import ContractProfile from '../components/ContractProfile';
|
||||
import DataWrapper from "../components/DataWrapper";
|
||||
import {getContractProfile} from "../reducers/selectors";
|
||||
|
||||
class ContractProfileContainer extends Component {
|
||||
componentDidMount() {
|
||||
this.props.fetchContractProfile(this.props.match.params.contractName);
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<DataWrapper shouldRender={this.props.contractProfile !== undefined } {...this.props} render={({contractProfile}) => (
|
||||
<ContractProfile contractProfile={contractProfile} />
|
||||
)} />
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function mapStateToProps(state, props) {
|
||||
return {
|
||||
contractProfile: getContractProfile(state, props.match.params.contractName),
|
||||
error: state.errorMessage,
|
||||
loading: state.loading
|
||||
};
|
||||
}
|
||||
|
||||
ContractProfileContainer.propTypes = {
|
||||
match: PropTypes.object,
|
||||
contractProfile: PropTypes.object,
|
||||
fetchContractProfile: PropTypes.func,
|
||||
error: PropTypes.string
|
||||
};
|
||||
|
||||
export default withRouter(connect(
|
||||
mapStateToProps,
|
||||
{
|
||||
fetchContractProfile: contractProfileAction.request
|
||||
}
|
||||
)(ContractProfileContainer));
|
Loading…
Reference in New Issue