From 4c6e97a9986db532a0994308ef8307febc080d3d Mon Sep 17 00:00:00 2001 From: elforjani3 Date: Thu, 11 Mar 2021 22:29:56 +0200 Subject: [PATCH] refactoring(quick payment receive): add MoneyInput. --- .../QuickPaymentReceiveFormFields.js | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/client/src/containers/Dialogs/QuickPaymentReceiveFormDialog/QuickPaymentReceiveFormFields.js b/client/src/containers/Dialogs/QuickPaymentReceiveFormDialog/QuickPaymentReceiveFormFields.js index f0fb1f45d..e407c23ef 100644 --- a/client/src/containers/Dialogs/QuickPaymentReceiveFormDialog/QuickPaymentReceiveFormFields.js +++ b/client/src/containers/Dialogs/QuickPaymentReceiveFormDialog/QuickPaymentReceiveFormFields.js @@ -14,7 +14,12 @@ import classNames from 'classnames'; import { CLASSES } from 'common/classes'; import { DateInput } from '@blueprintjs/datetime'; import { FieldRequiredHint, Col, Row } from 'components'; -import { AccountsSelectList, InputPrependText, Icon } from 'components'; +import { + AccountsSelectList, + InputPrependText, + MoneyInputGroup, + Icon, +} from 'components'; import { inputIntent, momentFormatter, @@ -78,7 +83,11 @@ export default function QuickPaymentReceiveFormFields({}) { {/*------------ Amount Received -----------*/} - {({ form: { values }, field, meta: { error, touched } }) => ( + {({ + form: { values, setFieldValue }, + field: { value }, + meta: { error, touched }, + }) => ( } labelInfo={} @@ -89,11 +98,14 @@ export default function QuickPaymentReceiveFormFields({}) { - { + setFieldValue('payment_amount', amount); + }} + intent={inputIntent({ error, touched })} inputRef={(ref) => (paymentReceiveFieldRef.current = ref)} - {...field} />