import React from 'react'; import { FastField, ErrorMessage } from 'formik'; import { Classes, FormGroup, TextArea, Position } from '@blueprintjs/core'; import { DateInput } from '@blueprintjs/datetime'; import classNames from 'classnames'; import { CLASSES } from 'common/classes'; import { FieldRequiredHint, FormattedMessage as T } from 'components'; import { useAutofocus } from 'hooks'; import { inputIntent, momentFormatter, tansformDateValue, handleDateChange, } from 'utils'; /** * locking Transactions form fields. */ export default function LockingTransactionsFormFields() { const dateFieldRef = useAutofocus(); return (
{/*------------ Locking Date -----------*/} {({ form, field: { value }, meta: { error, touched } }) => ( } labelInfo={} intent={inputIntent({ error, touched })} helperText={} minimal={true} className={classNames(CLASSES.FILL, 'form-group--date')} > { form.setFieldValue('lock_to_date', formattedDate); })} value={tansformDateValue(value)} popoverProps={{ position: Position.BOTTOM, minimal: true, }} intent={inputIntent({ error, touched })} inputRef={(ref) => (dateFieldRef.current = ref)} /> )} {/*------------ Locking Reason -----------*/} {({ field, meta: { error, touched } }) => ( } labelInfo={} className={'form-group--reason'} intent={inputIntent({ error, touched })} helperText={} >