Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

psp-8185 remove closebutton generic modal prop - show custom pims clo… #4026

Merged
merged 4 commits into from
May 21, 2024
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
13 changes: 4 additions & 9 deletions source/frontend/src/components/common/GenericModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ export interface ModalContent {
headerIcon?: string | React.ReactNode;
/** Optional message to display - no default. */
message?: string | React.ReactNode;
/** optional override to control the x button in the top right of the modal. Default is to show. */
closeButton?: boolean;
/** provide the size of the modal, default width is 50.0rem */
modalSize?: ModalSize;
variant: 'info' | 'warning' | 'error';
Expand Down Expand Up @@ -117,7 +115,6 @@ export const GenericModal = (props: Omit<BsModalProps, 'onHide'> & ModalProps) =
okButtonHref,
cancelButtonVariant,
cancelButtonText,
closeButton,
hideFooter,
modalSize = ModalSize.MEDIUM,
variant,
Expand Down Expand Up @@ -211,19 +208,17 @@ export const GenericModal = (props: Omit<BsModalProps, 'onHide'> & ModalProps) =
onHide={noop}
className={getModalClass()}
>
<Modal.Header closeButton={closeButton} onHide={close}>
<Modal.Header onHide={close}>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This closebutton actually causes a few problems.

Clicking this close button does not fire our close event.
the styling is hard to see and does not use one of our approved icons.

{headerIconValue && (
<>
<div className="header-icon">{headerIconValue}</div>
<Spacing8 />
</>
)}
<Modal.Title>{title}</Modal.Title>
{!closeButton && (
<div className="modal-close-btn">
<FaWindowClose size={24} onClick={close} />
</div>
)}
<div className="modal-close-btn">
<FaWindowClose size={24} onClick={close} />
</div>
</Modal.Header>

<Modal.Body style={{ whiteSpace: 'pre-line' }}>{message}</Modal.Body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ export const DepositsContainer: React.FunctionComponent<
message={`Are you sure you want to remove the deposit?`}
handleOk={() => onDeleteDepositConfirmed()}
okButtonText="OK"
closeButton
setDisplay={setDeleteModalWarning}
/>
<GenericModal
Expand All @@ -249,7 +248,6 @@ export const DepositsContainer: React.FunctionComponent<
message={`Are you sure you want to remove this deposit return?`}
handleOk={() => onDeleteDepositReturnConfirmed()}
okButtonText="OK"
closeButton
setDisplay={setDeleteReturnModalWarning}
/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ export const NoteDetailsFormModal: React.FC<
okButtonText="Close"
handleOk={onCloseClick}
handleCancel={onCloseClick}
closeButton
></StyledModal>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export const UpdateNoteFormModal = React.forwardRef<
display={isOpened}
title="Notes"
message={loading ? spinner : <FormBody {...formikProps}></FormBody>}
closeButton
okButtonText="Save"
cancelButtonText="Cancel"
handleOk={() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export const SideProjectContainer: React.FunctionComponent<ISideProjectContainer
title: 'Warning',
message: 'There is no data for the input parameters you entered.',
okButtonText: 'Close',
closeButton: true,
handleOk: () => setDisplayModal(false),
});
setDisplayModal(true);
Expand All @@ -75,7 +74,6 @@ export const SideProjectContainer: React.FunctionComponent<ISideProjectContainer
title: 'Warning',
message: 'There is no data for the input parameters you entered.',
okButtonText: 'Close',
closeButton: true,
handleOk: () => setDisplayModal(false),
});
setDisplayModal(true);
Expand Down
Loading