fix(webapp): use all drawers name from common enum object

This commit is contained in:
Ahmed Bouhuolia
2023-06-14 19:51:14 +02:00
parent 01c27b56ef
commit d1a09e3b15
99 changed files with 286 additions and 186 deletions

View File

@@ -21,6 +21,7 @@ import withAlertsActions from '@/containers/Alert/withAlertActions';
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
import { compose } from '@/utils';
import { DRAWERS } from '@/constants/drawers';
/**
* Expense drawer action bar.
@@ -40,7 +41,7 @@ function ExpenseDrawerActionBar({
// Handle the expense edit action.
const handleEditExpense = () => {
history.push(`/expenses/${expense.id}/edit`);
closeDrawer('expense-drawer');
closeDrawer(DRAWERS.EXPENSE_DETAILS);
};
// Handle the expense delete action.

View File

@@ -5,6 +5,7 @@ import { useExpense } from '@/hooks/query';
import { DrawerHeaderContent, DrawerLoading } from '@/components';
import { Features } from '@/constants';
import { useFeatureCan } from '@/hooks/state';
import { DRAWERS } from '@/constants/drawers';
const ExpenseDrawerDrawerContext = React.createContext();
@@ -36,7 +37,7 @@ function ExpenseDrawerProvider({ expenseId, ...props }) {
return (
<DrawerLoading loading={isExpenseLoading}>
<DrawerHeaderContent
name="expense-drawer"
name={DRAWERS.EXPENSE_DETAILS}
title={intl.get('expense.drawer.title')}
subTitle={
featureCan(Features.Branches)