37 lines
1019 B
JavaScript
Raw Normal View History

2018-08-02 15:17:40 -04:00
import React from 'react';
import FunctionForm from './function-form';
import PropTypes from 'prop-types';
2018-04-16 14:05:57 -04:00
class FunctionArea extends React.Component {
2018-08-02 15:17:40 -04:00
constructor(props) {
super(props);
this.state = {};
}
render() {
const type = this.props.type;
const contract = this.props.contract;
const contractName = this.props.contractName;
2018-04-16 14:05:57 -04:00
2018-08-02 15:17:40 -04:00
return <React.Fragment>
{
this.props.contract.options.jsonInterface
.filter(item => item.type === type)
.map((item, i) => <FunctionForm definition={this.props.definition} key={i} contract={contract}
contractName={contractName} abi={item}
instanceUpdate={this.props.instanceUpdate}/>)
}
</React.Fragment>;
}
2018-04-16 14:05:57 -04:00
}
2018-08-02 15:17:40 -04:00
FunctionArea.propTypes = {
type: PropTypes.string,
contract: PropTypes.object,
contractName: PropTypes.string,
definition: PropTypes.object,
instanceUpdate: PropTypes.func
};
export default FunctionArea;