mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-22 15:50:32 +00:00
refactoring(quick payment receive): add MoneyInput.
This commit is contained in:
@@ -14,7 +14,12 @@ import classNames from 'classnames';
|
|||||||
import { CLASSES } from 'common/classes';
|
import { CLASSES } from 'common/classes';
|
||||||
import { DateInput } from '@blueprintjs/datetime';
|
import { DateInput } from '@blueprintjs/datetime';
|
||||||
import { FieldRequiredHint, Col, Row } from 'components';
|
import { FieldRequiredHint, Col, Row } from 'components';
|
||||||
import { AccountsSelectList, InputPrependText, Icon } from 'components';
|
import {
|
||||||
|
AccountsSelectList,
|
||||||
|
InputPrependText,
|
||||||
|
MoneyInputGroup,
|
||||||
|
Icon,
|
||||||
|
} from 'components';
|
||||||
import {
|
import {
|
||||||
inputIntent,
|
inputIntent,
|
||||||
momentFormatter,
|
momentFormatter,
|
||||||
@@ -78,7 +83,11 @@ export default function QuickPaymentReceiveFormFields({}) {
|
|||||||
</Row>
|
</Row>
|
||||||
{/*------------ Amount Received -----------*/}
|
{/*------------ Amount Received -----------*/}
|
||||||
<FastField name={'payment_amount'}>
|
<FastField name={'payment_amount'}>
|
||||||
{({ form: { values }, field, meta: { error, touched } }) => (
|
{({
|
||||||
|
form: { values, setFieldValue },
|
||||||
|
field: { value },
|
||||||
|
meta: { error, touched },
|
||||||
|
}) => (
|
||||||
<FormGroup
|
<FormGroup
|
||||||
label={<T id={'amount_received'} />}
|
label={<T id={'amount_received'} />}
|
||||||
labelInfo={<FieldRequiredHint />}
|
labelInfo={<FieldRequiredHint />}
|
||||||
@@ -89,11 +98,14 @@ export default function QuickPaymentReceiveFormFields({}) {
|
|||||||
<ControlGroup>
|
<ControlGroup>
|
||||||
<InputPrependText text={values.currency_code} />
|
<InputPrependText text={values.currency_code} />
|
||||||
|
|
||||||
<InputGroup
|
<MoneyInputGroup
|
||||||
intent={inputIntent({ error, touched })}
|
value={value}
|
||||||
minimal={true}
|
minimal={true}
|
||||||
|
onChange={(amount) => {
|
||||||
|
setFieldValue('payment_amount', amount);
|
||||||
|
}}
|
||||||
|
intent={inputIntent({ error, touched })}
|
||||||
inputRef={(ref) => (paymentReceiveFieldRef.current = ref)}
|
inputRef={(ref) => (paymentReceiveFieldRef.current = ref)}
|
||||||
{...field}
|
|
||||||
/>
|
/>
|
||||||
</ControlGroup>
|
</ControlGroup>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user