Commit f466f4a5 authored by Axel Bocciarelli's avatar Axel Bocciarelli
Browse files

Fix DOM nesting and improve labels of address pickers

parent 03bfa137
...@@ -206,21 +206,23 @@ function ParcelFormModal(props) { ...@@ -206,21 +206,23 @@ function ParcelFormModal(props) {
<FormGroup controlId="shippingAddress"> <FormGroup controlId="shippingAddress">
<Col {...FORM_LAYOUT.labelCol}> <Col {...FORM_LAYOUT.labelCol}>
<ControlLabel>Address of sender</ControlLabel> <ControlLabel>Address of sender</ControlLabel>
<p> <DropdownButton
<DropdownButton title="Choose" id="shippingAddressAutoFill"> title="Choose from my addresses"
{addresses.map((a) => ( id="shippingAddressAutoFill"
<MenuItem className={styles.dropdown}
key={a._id} >
eventKey={a._id} {addresses.map((a) => (
onSelect={() => <MenuItem
reset({ ...getValues(), shippingAddress: a }) key={a._id}
} eventKey={a._id}
> onSelect={() =>
{addressFormatter(a)} reset({ ...getValues(), shippingAddress: a })
</MenuItem> }
))} >
</DropdownButton> {addressFormatter(a)}
</p> </MenuItem>
))}
</DropdownButton>
</Col> </Col>
<Col {...FORM_LAYOUT.fieldCol}> <Col {...FORM_LAYOUT.fieldCol}>
<AddressTextFieldsForm addressObjName={'shippingAddress'} /> <AddressTextFieldsForm addressObjName={'shippingAddress'} />
...@@ -239,25 +241,27 @@ function ParcelFormModal(props) { ...@@ -239,25 +241,27 @@ function ParcelFormModal(props) {
<p className={styles.info}> <p className={styles.info}>
Where to return the parcel at the end of the investigation. Where to return the parcel at the end of the investigation.
</p> </p>
<p> <DropdownButton
<DropdownButton title="Choose" id="returnAddressAutoFill"> title="Choose from my addresses"
{addresses.map((a) => ( id="returnAddressAutoFill"
<MenuItem className={styles.dropdown}
key={a._id} >
eventKey={a._id} {addresses.map((a) => (
onSelect={() => <MenuItem
reset({ key={a._id}
...getValues(), eventKey={a._id}
returnAddress: a, onSelect={() =>
noReturnAddress: false, reset({
}) ...getValues(),
} returnAddress: a,
> noReturnAddress: false,
{addressFormatter(a)} })
</MenuItem> }
))} >
</DropdownButton> {addressFormatter(a)}
</p> </MenuItem>
))}
</DropdownButton>
</Col> </Col>
<Col {...FORM_LAYOUT.fieldCol}> <Col {...FORM_LAYOUT.fieldCol}>
<Checkbox <Checkbox
......
.info { .info {
font-size: smaller; font-size: smaller;
margin-bottom: 0;
} }
.hint { .hint {
...@@ -10,3 +11,7 @@ ...@@ -10,3 +11,7 @@
.returnCheckbox { .returnCheckbox {
margin-bottom: 10px !important; margin-bottom: 10px !important;
} }
.dropdown {
margin-top: 5px;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment