Skip to content

Commit

Permalink
fixed buy/sell form validations
Browse files Browse the repository at this point in the history
  • Loading branch information
farrah-deriv committed Jul 27, 2022
1 parent 9a2977b commit 6739446
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions packages/p2p/src/components/buy-sell/buy-sell-form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ const BuySellForm = props => {
validate={buy_sell_store.validatePopup}
validateOnMount={!should_disable_field}
initialValues={{
amount: input_amount,
amount: min_order_amount_limit,
contact_info: buy_sell_store.contact_info,
payment_info: buy_sell_store.payment_info,
rate: rate_type === ad_type.FLOAT ? effective_rate : null,
}}
initialErrors={buy_sell_store.is_sell_advert ? { contact_info: true } : {}}
onSubmit={(...args) => buy_sell_store.handleSubmit(() => isMounted(), ...args)}
>
{({ errors, isSubmitting, isValid, setFieldValue, submitForm, touched, values }) => {
{({ errors, isSubmitting, isValid, setFieldValue, submitForm, touched }) => {
buy_sell_store.form_props.setIsSubmitDisabled(
!isValid ||
isSubmitting ||
Expand Down Expand Up @@ -390,7 +390,7 @@ const BuySellForm = props => {
}
}}
required
value={values.amount}
value={input_amount}
disabled={should_disable_field}
/>
)}
Expand Down Expand Up @@ -427,9 +427,6 @@ const BuySellForm = props => {
initial_character_count={buy_sell_store.payment_info.length}
max_characters={300}
disabled={should_disable_field}
onBlur={event => {
buy_sell_store.setPaymentInfo(event.target.value);
}}
/>
)}
</Field>
Expand All @@ -449,9 +446,6 @@ const BuySellForm = props => {
initial_character_count={buy_sell_store.contact_info.length}
max_characters={300}
disabled={should_disable_field}
onBlur={event => {
buy_sell_store.setContactInfo(event.target.value);
}}
/>
)}
</Field>
Expand Down

0 comments on commit 6739446

Please sign in to comment.