Skip to content

Commit

Permalink
Info fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
FuriousLlama committed Dec 1, 2023
1 parent 825114a commit bdb5fee
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 20 deletions.
12 changes: 8 additions & 4 deletions source/frontend/src/components/common/GenericModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export const GenericModal = (props: Omit<BsModalProps, 'onHide'> & ModalProps) =
}
};

const getVariantClass = () => {
function getVariantClass() {
switch (variant) {
case 'info':
return 'info-variant';
Expand All @@ -172,10 +172,14 @@ export const GenericModal = (props: Omit<BsModalProps, 'onHide'> & ModalProps) =
return 'error-variant';
}
default: {
return '';
return 'info-variant';
}
}
};
}

function getModalClass() {
return (className || '') + ' ' + getVariantClass();
}

const headerIconValue = getHeaderIcon();

Expand All @@ -186,7 +190,7 @@ export const GenericModal = (props: Omit<BsModalProps, 'onHide'> & ModalProps) =
show={showState}
modalSize={modalSize}
onHide={noop}
className={className ?? '' + getVariantClass()}
className={getModalClass()}
>
<Modal.Header closeButton={closeButton} onHide={close}>
<Modal.Title>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const ErrorModal = ({ errors, show, setShow }: IErrorModalProps) => {
display={show}
handleCancel={handleClose}
title="Errors"
okButtonText="Close & Clear Errors"
okButtonText="Close"
handleOk={handleClear}
message={
<ErrorWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const GenerateLetterRecipientsModal: React.FunctionComponent<
>
{formikProps => (
<StyledModal
className="info"
variant="info"
display={isOpened}
title="Generate letter"
message={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,13 +292,14 @@ exports[`GenerateLetterRecipients modal renders as expected 1`] = `
/>
<div
aria-modal="true"
class="fade c0 c1 info modal show"
class="fade c0 c1 info-variant modal show"
role="dialog"
style="display: block;"
tabindex="-1"
>
<div
class="modal-dialog c1 info"
class="modal-dialog c1 info-variant"
variant="info"
>
<div
class="modal-content"
Expand All @@ -309,6 +310,23 @@ exports[`GenerateLetterRecipients modal renders as expected 1`] = `
<div
class="modal-title h4"
>
<div
class="header-icon"
>
<svg
fill="currentColor"
height="22"
stroke="currentColor"
stroke-width="0"
viewBox="0 0 512 512"
width="22"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"
/>
</svg>
</div>
Generate letter
</div>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,13 +284,13 @@ exports[`NoteContainer component renders as expected 1`] = `
/>
<div
aria-modal="true"
class="fade c0 c1 modal show"
class="fade c0 c1 info-variant modal show"
role="dialog"
style="display: block;"
tabindex="-1"
>
<div
class="modal-dialog c1"
class="modal-dialog c1 info-variant"
>
<div
class="modal-content"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,13 @@ exports[`AddNotesContainer component renders as expected 1`] = `
/>
<div
aria-modal="true"
class="fade c0 c1 modal show"
class="fade c0 c1 info-variant modal show"
role="dialog"
style="display: block;"
tabindex="-1"
>
<div
class="modal-dialog c1"
class="modal-dialog c1 info-variant"
>
<div
class="modal-content"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,13 @@ exports[`AddNotesFormModal component renders as expected 1`] = `
/>
<div
aria-modal="true"
class="fade c0 c1 modal show"
class="fade c0 c1 info-variant modal show"
role="dialog"
style="display: block;"
tabindex="-1"
>
<div
class="modal-dialog c1"
class="modal-dialog c1 info-variant"
>
<div
class="modal-content"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,13 +284,13 @@ exports[`NoteDetailsFormModal component renders as expected 1`] = `
/>
<div
aria-modal="true"
class="fade c0 c1 modal show"
class="fade c0 c1 info-variant modal show"
role="dialog"
style="display: block;"
tabindex="-1"
>
<div
class="modal-dialog c1"
class="modal-dialog c1 info-variant"
>
<div
class="modal-content"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,13 @@ exports[`UpdateNoteContainer component renders as expected 1`] = `
/>
<div
aria-modal="true"
class="fade c0 c1 modal show"
class="fade c0 c1 info-variant modal show"
role="dialog"
style="display: block;"
tabindex="-1"
>
<div
class="modal-dialog c1"
class="modal-dialog c1 info-variant"
>
<div
class="modal-content"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,13 @@ exports[`UpdateNoteFormModal component renders as expected 1`] = `
/>
<div
aria-modal="true"
class="fade c0 c1 modal show"
class="fade c0 c1 info-variant modal show"
role="dialog"
style="display: block;"
tabindex="-1"
>
<div
class="modal-dialog c1"
class="modal-dialog c1 info-variant"
>
<div
class="modal-content"
Expand Down

0 comments on commit bdb5fee

Please sign in to comment.