Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 213c774

Browse files
committed
Added comments for Modal. Disabled payment Cancel button for payments with Cancelled status.
1 parent 519a289 commit 213c774

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/components/Modal/index.jsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,21 @@ const classNames = {
1313
};
1414
const closeIcon = <IconCross />;
1515

16+
/**
17+
* Displays a modal with Approve- and Dismiss-button and an overlay.
18+
*
19+
* @param {Object} props component properties
20+
* @param {string} [props.approveText] text for Approve-button
21+
* @param {Object} props.children elements that will be shown inside modal
22+
* @param {?Object} [props.controls] custom controls that will be shown below
23+
* modal's contents
24+
* @param {string} [props.dismissText] text for Dismiss-button
25+
* @param {boolean} props.isOpen whether to show or hide the modal
26+
* @param {() => void} [props.onApprove] function called on approve action
27+
* @param {() => void} props.onDismiss function called on dismiss action
28+
* @param {string} [props.title] text for modal title
29+
* @returns {JSX.Element}
30+
*/
1631
const Modal = ({
1732
approveText = "Apply",
1833
children,

src/routes/WorkPeriods/components/PaymentCancel/index.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ const PaymentCancel = ({ className, item, timeout = 3000 }) => {
7575
return (
7676
<div className={cn(styles.container, className)}>
7777
<Button
78-
isDisabled={item.status === PAYMENT_STATUS.SCHEDULED}
78+
isDisabled={
79+
item.status === PAYMENT_STATUS.CANCELLED ||
80+
item.status === PAYMENT_STATUS.SCHEDULED
81+
}
7982
size="small"
8083
color="error"
8184
variant="contained"

0 commit comments

Comments
 (0)