mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-02-17 09:46:37 +00:00
fix indent and put submit on enter
This commit is contained in:
parent
29a0d5c658
commit
c8504b0024
@ -19,6 +19,14 @@ class Blockchain extends React.Component {
|
||||
this.setState({ valueSet: e.target.value });
|
||||
}
|
||||
|
||||
checkEnter(e, func) {
|
||||
if (e.key !== 'Enter') {
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
func.apply(this, [e]);
|
||||
}
|
||||
|
||||
setValue(e) {
|
||||
e.preventDefault();
|
||||
|
||||
@ -56,14 +64,15 @@ class Blockchain extends React.Component {
|
||||
render() {
|
||||
return (<React.Fragment>
|
||||
<h3> 1. Set the value in the blockchain</h3>
|
||||
<Form inline>
|
||||
<Form inline onKeyDown={(e) => this.checkEnter(e, this.setValue)}>
|
||||
<FormGroup>
|
||||
<FormControl
|
||||
type="text"
|
||||
defaultValue={this.state.valueSet}
|
||||
onChange={(e) => this.handleChange(e)}/>
|
||||
<Button bsStyle="primary" onClick={(e) => this.setValue(e)}>Set Value</Button>
|
||||
<HelpBlock>Once you set the value, the transaction will need to be mined and then the value will be updated on the blockchain.</HelpBlock>
|
||||
<HelpBlock>Once you set the value, the transaction will need to be mined and then the value will be updated
|
||||
on the blockchain.</HelpBlock>
|
||||
</FormGroup>
|
||||
</Form>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user