mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 12:20:31 +00:00
feat(RefundCreditNote): optimize style.
This commit is contained in:
@@ -15,7 +15,7 @@ function RefundCreditNoteFloatingActions({
|
||||
closeDialog,
|
||||
}) {
|
||||
// Formik context.
|
||||
const { isSubmitting, values, errors } = useFormikContext();
|
||||
const { isSubmitting } = useFormikContext();
|
||||
|
||||
// refund credit note dialog context.
|
||||
const { dialogName } = useRefundCreditNoteContext();
|
||||
@@ -34,7 +34,7 @@ function RefundCreditNoteFloatingActions({
|
||||
<Button
|
||||
intent={Intent.PRIMARY}
|
||||
loading={isSubmitting}
|
||||
style={{ minWidth: '85px' }}
|
||||
style={{ minWidth: '120px' }}
|
||||
type="submit"
|
||||
text={<T id={'refund'} />}
|
||||
/>
|
||||
|
||||
@@ -3,16 +3,15 @@ import { Formik } from 'formik';
|
||||
import { Intent } from '@blueprintjs/core';
|
||||
import intl from 'react-intl-universal';
|
||||
import moment from 'moment';
|
||||
import { omit, defaultTo } from 'lodash';
|
||||
import { omit } from 'lodash';
|
||||
|
||||
import { AppToaster } from 'components';
|
||||
import { useRefundCreditNoteContext } from './RefundCreditNoteFormProvider';
|
||||
import { CreateRefundCreditNoteFormSchema } from './RefundCreditNoteForm.schema';
|
||||
import RefundCreditNoteFormContent from './RefundCreditNoteFormContent';
|
||||
|
||||
import withSettings from 'containers/Settings/withSettings';
|
||||
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||
import { compose, transactionNumber } from 'utils';
|
||||
import { compose } from 'utils';
|
||||
|
||||
const defaultInitialValues = {
|
||||
from_account_id: '',
|
||||
@@ -39,7 +38,7 @@ function RefundCreditNoteForm({
|
||||
};
|
||||
|
||||
// Handles the form submit.
|
||||
const handleFormSubmit = (values, { setSubmitting, setFieldError }) => {
|
||||
const handleFormSubmit = (values, { setSubmitting }) => {
|
||||
const form = {
|
||||
...omit(values, ['currency_code', 'credits_remaining']),
|
||||
};
|
||||
|
||||
@@ -25,12 +25,10 @@ import {
|
||||
momentFormatter,
|
||||
tansformDateValue,
|
||||
handleDateChange,
|
||||
compose,
|
||||
} from 'utils';
|
||||
import { useAutofocus } from 'hooks';
|
||||
import { ACCOUNT_TYPE } from 'common/accountTypes';
|
||||
import { useRefundCreditNoteContext } from './RefundCreditNoteFormProvider';
|
||||
import withSettings from 'containers/Settings/withSettings';
|
||||
|
||||
/**
|
||||
* Refund credit note form fields.
|
||||
@@ -49,7 +47,7 @@ function RefundCreditNoteFormFields() {
|
||||
className={classNames('form-group--select-list', CLASSES.FILL)}
|
||||
intent={inputIntent({ error, touched })}
|
||||
helperText={<ErrorMessage name="date" />}
|
||||
inline={true}
|
||||
// inline={true}
|
||||
>
|
||||
<DateInput
|
||||
{...momentFormatter('YYYY/MM/DD')}
|
||||
@@ -78,7 +76,7 @@ function RefundCreditNoteFormFields() {
|
||||
className={classNames('form-group--amount', CLASSES.FILL)}
|
||||
intent={inputIntent({ error, touched })}
|
||||
helperText={<ErrorMessage name="amount" />}
|
||||
inline={true}
|
||||
// inline={true}
|
||||
>
|
||||
<ControlGroup>
|
||||
<InputPrependText text={values.currency_code} />
|
||||
@@ -103,7 +101,7 @@ function RefundCreditNoteFormFields() {
|
||||
className={classNames('form-group--reference', CLASSES.FILL)}
|
||||
intent={inputIntent({ error, touched })}
|
||||
helperText={<ErrorMessage name="reference" />}
|
||||
inline={true}
|
||||
// inline={true}
|
||||
>
|
||||
<InputGroup
|
||||
intent={inputIntent({ error, touched })}
|
||||
@@ -127,7 +125,7 @@ function RefundCreditNoteFormFields() {
|
||||
labelInfo={<FieldRequiredHint />}
|
||||
intent={inputIntent({ error, touched })}
|
||||
helperText={<ErrorMessage name={'from_account_id'} />}
|
||||
inline={true}
|
||||
// inline={true}
|
||||
>
|
||||
<AccountsSuggestField
|
||||
selectedAccountId={value}
|
||||
@@ -153,7 +151,7 @@ function RefundCreditNoteFormFields() {
|
||||
<FormGroup
|
||||
label={<T id={'refund_credit_note.dialog.description'} />}
|
||||
className={'form-group--description'}
|
||||
inline={true}
|
||||
// inline={true}
|
||||
>
|
||||
<TextArea growVertically={true} {...field} />
|
||||
</FormGroup>
|
||||
|
||||
Reference in New Issue
Block a user