mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
feat: optimize customer form performance.
feat: optimize item category form performance.
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import React, { useMemo, useCallback, useEffect } from 'react';
|
||||
import * as Yup from 'yup';
|
||||
import { useFormik, Formik, Form } from 'formik';
|
||||
import { Formik, Form } from 'formik';
|
||||
import { Intent } from '@blueprintjs/core';
|
||||
import { queryCache } from 'react-query';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { pick, pickBy } from 'lodash';
|
||||
import { useIntl } from 'react-intl';
|
||||
import classNames from 'classnames';
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import React from 'react';
|
||||
import { FastField, ErrorMessage } from 'formik';
|
||||
import {
|
||||
FormGroup,
|
||||
Intent,
|
||||
Classes,
|
||||
Checkbox,
|
||||
} from '@blueprintjs/core';
|
||||
|
||||
@@ -20,7 +20,7 @@ export default function ItemFormFloatingActions({ isSubmitting, itemId, onCancel
|
||||
</Button>
|
||||
|
||||
<Button className={'ml1'} disabled={isSubmitting}>
|
||||
<T id={'save_as_draft'} />
|
||||
<T id={'save_new'} />
|
||||
</Button>
|
||||
|
||||
<Button className={'ml1'} onClick={handleCancelBtnClick}>
|
||||
@@ -42,10 +42,4 @@ export default function ItemFormFloatingActions({ isSubmitting, itemId, onCancel
|
||||
</FastField>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// function areEqual(prevProps, nextProps) {
|
||||
// return prevProps.isSubmitting === nextProps.isSubmitting;
|
||||
// }
|
||||
|
||||
// export default memo(ItemFormFloatingActions, areEqual);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { Field, FastField, ErrorMessage } from 'formik';
|
||||
import { FormGroup, Intent, InputGroup, Position } from '@blueprintjs/core';
|
||||
import { FastField, ErrorMessage } from 'formik';
|
||||
import { FormGroup, InputGroup, Position } from '@blueprintjs/core';
|
||||
import { DateInput } from '@blueprintjs/datetime';
|
||||
import { AccountsSelectList, Col, Row, Hint } from 'components';
|
||||
import { CLASSES } from 'common/classes';
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import React, { useMemo } from 'react';
|
||||
import {
|
||||
FormGroup,
|
||||
Intent,
|
||||
InputGroup,
|
||||
RadioGroup,
|
||||
Classes,
|
||||
@@ -104,10 +103,7 @@ function ItemFormPrimarySection({
|
||||
helperText={<ErrorMessage name={'name'} />}
|
||||
inline={true}
|
||||
>
|
||||
<InputGroup
|
||||
medium={true}
|
||||
{...field}
|
||||
/>
|
||||
<InputGroup medium={true} {...field} />
|
||||
</FormGroup>
|
||||
)}
|
||||
</FastField>
|
||||
@@ -117,16 +113,12 @@ function ItemFormPrimarySection({
|
||||
{({ field, meta: { error, touched } }) => (
|
||||
<FormGroup
|
||||
label={<T id={'item_code'} />}
|
||||
labelInfo={<Hint />}
|
||||
className={' -group--item-sku'}
|
||||
className={'form-group--item_code'}
|
||||
intent={inputIntent({ error, touched })}
|
||||
helperText={<ErrorMessage name={'code'} />}
|
||||
inline={true}
|
||||
>
|
||||
<InputGroup
|
||||
medium={true}
|
||||
{...field}
|
||||
/>
|
||||
<InputGroup medium={true} {...field} />
|
||||
</FormGroup>
|
||||
)}
|
||||
</FastField>
|
||||
|
||||
Reference in New Issue
Block a user