Skip to content

Commit

Permalink
feat(redmine 1291405): fix review from Quentin
Browse files Browse the repository at this point in the history
  • Loading branch information
pereag committed May 15, 2024
1 parent 031e591 commit ccc8793
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions packages/haring-react/src/Form/AddressFields/AddressFields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,57 +63,42 @@ export function AddressFields(props: IAddressFieldsProps): ReactElement {

const inputs = [
{
description: streetProps.description,
error: errors?.street,
handleChange: (e: React.ChangeEvent<HTMLInputElement>) => {
onChange: (e: React.ChangeEvent<HTMLInputElement>) => {
onChangeHandle('street', e.target.value);
},
label: streetProps.label,
placeholder: streetProps.placeholder,
value: value?.street,
...streetProps,
},
{
description: numberProps.description,
error: errors?.number,
handleChange: (e: React.ChangeEvent<HTMLInputElement>) => {
onChange: (e: React.ChangeEvent<HTMLInputElement>) => {
onChangeHandle('number', e.target.value);
},
label: numberProps.label,
placeholder: numberProps.placeholder,
value: value?.number,
...numberProps,
},
{
description: cityProps.description,
error: errors?.city,
handleChange: (e: React.ChangeEvent<HTMLInputElement>) => {
onChange: (e: React.ChangeEvent<HTMLInputElement>) => {
onChangeHandle('city', e.target.value);
},
label: cityProps.label,
placeholder: cityProps.placeholder,
value: value?.city,
...cityProps,
},
{
description: postCodeProps.description,
error: errors?.postCode,
handleChange: (e: React.ChangeEvent<HTMLInputElement>) => {
onChangeHandle('postCode', e.target.value);
},
label: postCodeProps.label,
placeholder: postCodeProps.placeholder,
value: value?.postCode,
...postCodeProps,
},
{
description: countryProps.description,
error: errors?.country,
handleChange: (e: React.ChangeEvent<HTMLInputElement>) => {
onChange: (e: React.ChangeEvent<HTMLInputElement>) => {
onChangeHandle('country', e.target.value);
},
label: countryProps.label,
placeholder: countryProps.placeholder,
value: value?.country,
...countryProps,
},
Expand All @@ -126,7 +111,6 @@ export function AddressFields(props: IAddressFieldsProps): ReactElement {
<TextInput
key={input.label as string}
className={classes.input}
onChange={input.handleChange}
{...input}
/>
);
Expand Down

0 comments on commit ccc8793

Please sign in to comment.