feat(RefundCreditNote): optimize style.

This commit is contained in:
a.bouhuolia
2021-12-15 19:54:17 +02:00
parent c688b8700e
commit cfed874182
5 changed files with 23 additions and 37 deletions

View File

@@ -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'} />}
/>

View File

@@ -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']),
};

View File

@@ -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>