feat: add payment receive ability.

This commit is contained in:
elforjani13
2021-11-23 20:15:29 +02:00
parent 371e374dc5
commit 3a8e1f5238
5 changed files with 59 additions and 42 deletions

View File

@@ -16,7 +16,8 @@ import withDialogActions from 'containers/Dialog/withDialogActions';
import withAlertsActions from 'containers/Alert/withAlertActions';
import withDrawerActions from 'containers/Drawer/withDrawerActions';
import { Icon, FormattedMessage as T, MoreMenuItems } from 'components';
import { Can, Icon, FormattedMessage as T, MoreMenuItems } from 'components';
import { Payment_Receive_Abilities, AbilitySubject } from '../../../common/abilityOption';
import { compose } from 'utils';
@@ -57,21 +58,25 @@ function PaymentReceiveActionsBar({
return (
<DashboardActionsBar>
<NavbarGroup>
<Button
className={Classes.MINIMAL}
icon={<Icon icon="pen-18" />}
text={<T id={'edit_payment_receive'} />}
onClick={handleEditPaymentReceive}
/>
<NavbarDivider />
<Button
className={Classes.MINIMAL}
icon={<Icon icon={'trash-16'} iconSize={16} />}
text={<T id={'delete'} />}
intent={Intent.DANGER}
onClick={handleDeletePaymentReceive}
/>
<NavbarDivider />
<Can I={Payment_Receive_Abilities.Edit} a={AbilitySubject.PaymentReceive}>
<Button
className={Classes.MINIMAL}
icon={<Icon icon="pen-18" />}
text={<T id={'edit_payment_receive'} />}
onClick={handleEditPaymentReceive}
/>
<NavbarDivider />
</Can>
<Can I={Payment_Receive_Abilities.Delete} a={AbilitySubject.PaymentReceive}>
<Button
className={Classes.MINIMAL}
icon={<Icon icon={'trash-16'} iconSize={16} />}
text={<T id={'delete'} />}
intent={Intent.DANGER}
onClick={handleDeletePaymentReceive}
/>
<NavbarDivider />
</Can>
<MoreMenuItems
payload={{
onNotifyViaSMS: handleNotifyViaSMS,