diff --git a/client/src/containers/Customers/Customer.js b/client/src/containers/Customers/Customer.js index edf1552f2..2bc2b9a5e 100644 --- a/client/src/containers/Customers/Customer.js +++ b/client/src/containers/Customers/Customer.js @@ -42,7 +42,7 @@ function Customer({ const handleFormSubmit = useCallback( (payload) => { - payload.redirect && history.push('/customers'); + }, [history], ); diff --git a/client/src/containers/Customers/CustomerAddressTabs.js b/client/src/containers/Customers/CustomerAddressTabs.js index bc6e067b4..63f3824ed 100644 --- a/client/src/containers/Customers/CustomerAddressTabs.js +++ b/client/src/containers/Customers/CustomerAddressTabs.js @@ -1,16 +1,11 @@ import React from 'react'; -import { FormGroup, Intent, InputGroup, TextArea } from '@blueprintjs/core'; +import { FormGroup, InputGroup, TextArea } from '@blueprintjs/core'; import { Row, Col } from 'components'; import { FormattedMessage as T } from 'react-intl'; +import { FastField, ErrorMessage } from 'formik'; +import { inputIntent } from 'utils'; -import ErrorMessage from 'components/ErrorMessage'; - -const CustomerBillingAddress = ({ - errors, - touched, - setFieldValue, - getFieldProps, -}) => { +const CustomerBillingAddress = ({}) => { return (
@@ -19,172 +14,105 @@ const CustomerBillingAddress = ({ {/*------------ Billing Address country -----------*/} - - } - label={} - > - - + + {({ field, field: { value }, meta: { error, touched } }) => ( + } + label={} + > + + + )} + + {/*------------ Billing Address 1 -----------*/} - } - className={'form-group--address_line_1'} - intent={ - errors.billing_address_1 && - touched.billing_address_1 && - Intent.DANGER - } - inline={true} - helperText={ - - } - > -