mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
fix : cancel button in item Category dialog.
This commit is contained in:
@@ -24,6 +24,7 @@ export default function ItemCategoryForm({
|
||||
accountsList,
|
||||
categoriesList,
|
||||
isSubmitting,
|
||||
onClose
|
||||
}) {
|
||||
// Filters Item Categories list.
|
||||
const filterItemCategories = useCallback(
|
||||
@@ -203,7 +204,7 @@ export default function ItemCategoryForm({
|
||||
|
||||
<div className={Classes.DIALOG_FOOTER}>
|
||||
<div className={Classes.DIALOG_FOOTER_ACTIONS}>
|
||||
<Button>
|
||||
<Button onClick={onClose}>
|
||||
<T id={'close'} />
|
||||
</Button>
|
||||
<Button intent={Intent.PRIMARY} type="submit" disabled={isSubmitting}>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useMemo } from 'react';
|
||||
import React, { useMemo, useCallback } from 'react';
|
||||
import { Intent } from '@blueprintjs/core';
|
||||
import * as Yup from 'yup';
|
||||
import { useQuery, queryCache } from 'react-query';
|
||||
@@ -121,6 +121,11 @@ function ItemCategoryFormDialogContent({
|
||||
}
|
||||
};
|
||||
|
||||
// Handles dialog close.
|
||||
const handleClose = useCallback(() => {
|
||||
closeDialog(dialogName);
|
||||
}, [closeDialog, dialogName]);
|
||||
|
||||
return (
|
||||
<DialogContent
|
||||
isLoading={fetchCategoriesList.isFetching || fetchAccountsList.isFetching}
|
||||
@@ -136,6 +141,7 @@ function ItemCategoryFormDialogContent({
|
||||
accountsList={accountsList}
|
||||
categoriesList={categoriesList}
|
||||
isSubmitting={isSubmitting}
|
||||
onClose={handleClose}
|
||||
/>
|
||||
)}
|
||||
</Formik>
|
||||
|
||||
Reference in New Issue
Block a user