display better command listing on autotype

This commit is contained in:
Iuri Matias 2018-10-13 10:39:36 -04:00 committed by Pascal Precht
parent 2209aab934
commit 06ac5315a5
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
1 changed files with 12 additions and 2 deletions

View File

@ -92,7 +92,7 @@ class Console extends Component {
search={value}
autoFocus={true}
emptyLabel={false}
labelKey="name"
labelKey="value"
multiple={false}
emptyLabel={false}
maxResults={10}
@ -108,12 +108,22 @@ class Console extends Component {
}}
onSearch={(value) => {
console.dir(value);
this.setState({ isLoading: false, options: ['hello', 'dude', 'dude1'] })
this.setState({ isLoading: false, options: [{value: 'hello', command_type: "embark", description: "says hello back!"}, {value: 'SimpleStorage', command_type: "web3 object", description: ""}, {value: 'web3.eth.getAccounts', command_type: "web3", description: "get list of accounts"}] })
}}
filterBy={['value']}
maxHeight="200px"
placeholder="Type a command (e.g help)"
options={this.state.options}
placeholder="Choose a state..."
renderMenuItemChildren={(option) => (
<div>
{option.value}
<div>
<small>{option.command_type} - {option.description}</small>
</div>
</div>
)}
/>
</Card.Footer>}
</Card>