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

Modal component, payment cancelling, processing errors in popovers and other improvements #62

Merged
merged 12 commits into from
Jul 5, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added comments for Modal. Disabled payment Cancel button for payments…
… with Cancelled status.
  • Loading branch information
MadOPcode committed Jul 5, 2021
commit 213c7741857548edfb77b362027665b6f29a51ff
15 changes: 15 additions & 0 deletions src/components/Modal/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@ const classNames = {
};
const closeIcon = <IconCross />;

/**
* Displays a modal with Approve- and Dismiss-button and an overlay.
*
* @param {Object} props component properties
* @param {string} [props.approveText] text for Approve-button
* @param {Object} props.children elements that will be shown inside modal
* @param {?Object} [props.controls] custom controls that will be shown below
* modal's contents
* @param {string} [props.dismissText] text for Dismiss-button
* @param {boolean} props.isOpen whether to show or hide the modal
* @param {() => void} [props.onApprove] function called on approve action
* @param {() => void} props.onDismiss function called on dismiss action
* @param {string} [props.title] text for modal title
* @returns {JSX.Element}
*/
const Modal = ({
approveText = "Apply",
children,
Expand Down
5 changes: 4 additions & 1 deletion src/routes/WorkPeriods/components/PaymentCancel/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ const PaymentCancel = ({ className, item, timeout = 3000 }) => {
return (
<div className={cn(styles.container, className)}>
<Button
isDisabled={item.status === PAYMENT_STATUS.SCHEDULED}
isDisabled={
item.status === PAYMENT_STATUS.CANCELLED ||
item.status === PAYMENT_STATUS.SCHEDULED
}
size="small"
color="error"
variant="contained"
Expand Down