feat (*) : add referch button.

This commit is contained in:
elforjani3
2021-08-03 17:23:12 +02:00
parent b2c892b649
commit d2b75f6ed8
24 changed files with 408 additions and 148 deletions

View File

@@ -9,6 +9,7 @@ import {
PopoverInteractionKind,
Position,
Intent,
Alignment,
} from '@blueprintjs/core';
import classNames from 'classnames';
import { useHistory } from 'react-router-dom';
@@ -19,6 +20,7 @@ import withDialogActions from 'containers/Dialog/withDialogActions';
import { If, DashboardActionViewsList } from 'components';
import { useRefreshExpenses } from 'hooks/query/expenses';
import { useExpensesListContext } from './ExpensesListProvider';
import withExpensesActions from './withExpensesActions';
@@ -39,15 +41,16 @@ function ExpensesActionsBar({
// Expenses list context.
const { expensesViews } = useExpensesListContext();
// Expenses refresh action.
const { refresh } = useRefreshExpenses();
// Handles the new expense buttn click.
const onClickNewExpense = () => {
history.push('/expenses/new');
};
// Handle delete button click.
const handleBulkDelete = () => {
};
const handleBulkDelete = () => {};
// Handles the tab chaning.
const handleTabChange = (viewId) => {
@@ -55,6 +58,11 @@ function ExpensesActionsBar({
customViewId: viewId.id || null,
});
};
// Handle click a refresh
const handleRefreshBtnClick = () => {
refresh();
};
return (
<DashboardActionsBar>
<NavbarGroup>
@@ -81,7 +89,7 @@ function ExpensesActionsBar({
className={classNames(Classes.MINIMAL, 'button--filter', {
'has-active-filters': filterCount > 0,
})}
text={<T id={'filter'}/>}
text={<T id={'filter'} />}
icon={<Icon icon="filter-16" iconSize={16} />}
/>
</Popover>
@@ -112,6 +120,13 @@ function ExpensesActionsBar({
text={<T id={'export'} />}
/>
</NavbarGroup>
<NavbarGroup align={Alignment.RIGHT}>
<Button
className={Classes.MINIMAL}
icon={<Icon icon="refresh-16" iconSize={14} />}
onClick={handleRefreshBtnClick}
/>
</NavbarGroup>
</DashboardActionsBar>
);
}