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';
@@ -24,6 +25,7 @@ import withPaymentReceives from './withPaymentReceives';
import { compose } from 'utils';
import { usePaymentReceivesListContext } from './PaymentReceiptsListProvider';
import { useRefreshPaymentReceive } from 'hooks/query/paymentReceives';
/**
* Payment receives actions bar.
@@ -43,11 +45,19 @@ function PaymentReceiveActionsBar({
history.push('/payment-receives/new');
};
// Payment receive refresh action.
const { refresh } = useRefreshPaymentReceive();
// Handle tab changing.
const handleTabChange = (viewId) => {
setPaymentReceivesTableState({ customViewId: viewId.id || null });
};
// Handle click a refresh payment receives
const handleRefreshBtnClick = () => {
refresh();
};
return (
<DashboardActionsBar>
<NavbarGroup>
@@ -100,6 +110,13 @@ function PaymentReceiveActionsBar({
text={<T id={'export'} />}
/>
</NavbarGroup>
<NavbarGroup align={Alignment.RIGHT}>
<Button
className={Classes.MINIMAL}
icon={<Icon icon="refresh-16" iconSize={14} />}
onClick={handleRefreshBtnClick}
/>
</NavbarGroup>
</DashboardActionsBar>
);
}