fix : correct rename variable in sale & purchase floating Actions.

This commit is contained in:
elforjani3
2021-01-03 19:43:25 +02:00
parent a2284945f1
commit 31e4b7f0e0
8 changed files with 32 additions and 46 deletions

View File

@@ -23,9 +23,7 @@ export default function EstimateFloatingActions({
isSubmitting,
onSubmitClick,
onCancelClick,
onClearClick,
estimateId,
isDelivered,
estimate,
}) {
const { resetForm, submitForm } = useFormikContext();
@@ -82,14 +80,13 @@ export default function EstimateFloatingActions({
};
const handleClearBtnClick = (event) => {
// saveInvoke(onClearClick, event);
resetForm();
};
return (
<div className={classNames(CLASSES.PAGE_FORM_FLOATING_ACTIONS)}>
{/* ----------- Save And Deliver ----------- */}
<If condition={!estimateId || !isDelivered}>
<If condition={!estimate || !estimate?.is_delivered}>
<ButtonGroup>
<Button
disabled={isSubmitting}
@@ -156,7 +153,7 @@ export default function EstimateFloatingActions({
</ButtonGroup>
</If>
{/* ----------- Save and New ----------- */}
<If condition={estimateId && isDelivered}>
<If condition={estimate && estimate?.is_delivered}>
<ButtonGroup>
<Button
disabled={isSubmitting}
@@ -192,7 +189,7 @@ export default function EstimateFloatingActions({
className={'ml1'}
disabled={isSubmitting}
onClick={handleClearBtnClick}
text={estimateId ? <T id={'reset'} /> : <T id={'clear'} />}
text={estimate ? <T id={'reset'} /> : <T id={'clear'} />}
/>
{/* ----------- Cancel ----------- */}
<Button

View File

@@ -264,7 +264,7 @@ const EstimateForm = ({
initialValues={initialValues}
onSubmit={handleFormSubmit}
>
{({ isSubmitting, values }) => (
{({ isSubmitting}) => (
<Form>
<EstimateFormHeader
onEstimateNumberChanged={handleEstimateNumberChange}
@@ -274,10 +274,9 @@ const EstimateForm = ({
<EstimateFormFooter />
<EstimateFloatingActions
isSubmitting={isSubmitting}
estimateId={estimateId}
estimate={estimate}
onSubmitClick={handleSubmitClick}
onCancelClick={handleCancelClick}
isDelivered={values.delivered}
/>
</Form>
)}