add use primary address for setting address in resolver
This commit is contained in:
parent
c02a8b5959
commit
7582615a37
|
@ -16,6 +16,7 @@ const InnerForm = ({
|
|||
handleBlur,
|
||||
handleSubmit,
|
||||
isSubmitting,
|
||||
setFieldValue
|
||||
}) => (
|
||||
<form onSubmit={handleSubmit}>
|
||||
<FieldGroup
|
||||
|
@ -46,6 +47,7 @@ const InnerForm = ({
|
|||
onBlur={handleBlur}
|
||||
value={values.address}
|
||||
error={errors.address}
|
||||
button={<Button style={{ marginTop: '5px' }} onClick={() => setFieldValue('address', web3.eth.defaultAccount)}>Use My Primary Address</Button>}
|
||||
/>
|
||||
<Button bsStyle="primary" type="submit" disabled={isSubmitting || !!Object.keys(errors).length}>{!isSubmitting ? 'Submit' : 'Submitting to the Blockchain - (this may take awhile)'}</Button>
|
||||
</form>
|
||||
|
|
|
@ -1,10 +1,18 @@
|
|||
import React from 'react';
|
||||
import { FormGroup, FormControl, HelpBlock, ControlLabel } from 'react-bootstrap';
|
||||
import { FormGroup, FormControl, HelpBlock, ControlLabel, InputGroup } from 'react-bootstrap';
|
||||
|
||||
const FieldGroup = ({ id, label, error, ...props }) => (
|
||||
const FieldGroup = ({ id, label, button, error, ...props }) => (
|
||||
<FormGroup controlId={id} validationState={error ? 'error' : null}>
|
||||
<ControlLabel>{label}</ControlLabel>
|
||||
{button
|
||||
? <InputGroup>
|
||||
<InputGroup.Button>
|
||||
{button}
|
||||
</InputGroup.Button>
|
||||
<FormControl {...props} />
|
||||
</InputGroup>
|
||||
: <FormControl {...props} />
|
||||
}
|
||||
{error && <HelpBlock>{error}</HelpBlock>}
|
||||
</FormGroup>
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue