|
1 | 1 | // The original class was from here: https://github.com/trufflesuite/drizzle-react-components/blob/develop/src/ContractForm.js
|
2 | 2 | // Much changed since then. The following PropTypes were added:
|
3 | 3 | // contractAddress, contractName: used to get the contract via truffle-contract
|
4 |
| -// fixArgs: for SC method arguments that are not for the user to set |
| 4 | +// staticArgs: additional arguments, which are always submitted regardless of the input arguments |
5 | 5 | // hideArgs: for SC method arguments that are being set computationally, based on the user's input in other fields
|
6 | 6 | // buttonLabel: to customize the submit-button at the end of the form
|
7 | 7 | // specialFields: this is used by the ProofSubmission class to customize the fields for requesting location access and for uploading a picture to IPFS
|
@@ -89,8 +89,8 @@ class ContractForm extends Component {
|
89 | 89 | var paramValuesIndicesArr = [];
|
90 | 90 |
|
91 | 91 | const convertedInputs = this.inputs.map(input => {
|
92 |
| - if (this.props.fixArgs && this.props.fixArgs[input.name]) { |
93 |
| - return this.props.fixArgs[input.name]; |
| 92 | + if (this.props.staticArgs && this.props.staticArgs[input.name]) { |
| 93 | + return this.props.staticArgs[input.name]; |
94 | 94 | }
|
95 | 95 |
|
96 | 96 | if (this.props.hideArgs && this.props.hideArgs[input.name] && this.props.multiSelectOptions) {
|
@@ -273,7 +273,7 @@ class ContractForm extends Component {
|
273 | 273 | <form onSubmit={this.handleSubmit} autoComplete="off">
|
274 | 274 | {this.inputs.map(({ name, type }, index) => {
|
275 | 275 | if (
|
276 |
| - (this.props.fixArgs && this.props.fixArgs[name]) || |
| 276 | + (this.props.staticArgs && this.props.staticArgs[name]) || |
277 | 277 | (this.props.hideArgs && this.props.hideArgs[name])
|
278 | 278 | ) {
|
279 | 279 | return '';
|
|
0 commit comments