|
|
@@ -25,7 +25,7 @@ export const DeleteCommentModal = (props: DeleteCommentModalProps): JSX.Element
|
|
|
isShown, comment, errorMessage, cancelToDelete, confirmToDelete,
|
|
|
} = props;
|
|
|
|
|
|
- const headerContent = useMemo(() => {
|
|
|
+ const headerContent = () => {
|
|
|
if (comment == null || isShown === false) {
|
|
|
return <></>;
|
|
|
}
|
|
|
@@ -35,9 +35,9 @@ export const DeleteCommentModal = (props: DeleteCommentModalProps): JSX.Element
|
|
|
Delete comment?
|
|
|
</span>
|
|
|
);
|
|
|
- }, [comment, isShown]);
|
|
|
+ };
|
|
|
|
|
|
- const bodyContent = useMemo(() => {
|
|
|
+ const bodyContent = () => {
|
|
|
if (comment == null || isShown === false) {
|
|
|
return <></>;
|
|
|
}
|
|
|
@@ -59,9 +59,9 @@ export const DeleteCommentModal = (props: DeleteCommentModalProps): JSX.Element
|
|
|
<p className="card well comment-body mt-2 p-2">{commentBodyElement}</p>
|
|
|
</>
|
|
|
);
|
|
|
- }, [comment, isShown]);
|
|
|
+ };
|
|
|
|
|
|
- const footerContent = useMemo(() => {
|
|
|
+ const footerContent = () => {
|
|
|
if (comment == null || isShown === false) {
|
|
|
return <></>;
|
|
|
}
|
|
|
@@ -75,18 +75,18 @@ export const DeleteCommentModal = (props: DeleteCommentModalProps): JSX.Element
|
|
|
</Button>
|
|
|
</>
|
|
|
);
|
|
|
- }, [cancelToDelete, comment, confirmToDelete, errorMessage, isShown]);
|
|
|
+ };
|
|
|
|
|
|
return (
|
|
|
<Modal isOpen={isShown} toggle={cancelToDelete} className={`${styles['page-comment-delete-modal']}`}>
|
|
|
<ModalHeader tag="h4" toggle={cancelToDelete} className="bg-danger text-light">
|
|
|
- {headerContent}
|
|
|
+ {headerContent()}
|
|
|
</ModalHeader>
|
|
|
<ModalBody>
|
|
|
- {bodyContent}
|
|
|
+ {bodyContent()}
|
|
|
</ModalBody>
|
|
|
<ModalFooter>
|
|
|
- {footerContent}
|
|
|
+ {footerContent()}
|
|
|
</ModalFooter>
|
|
|
</Modal>
|
|
|
);
|