Add condition to modal

This way we prevent unwanted data loading, invisible updates
and visual artifacts when the modal isn't visible.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2022-01-06 22:36:28 +01:00
parent 89eac12a38
commit 9500887ee6

View file

@ -48,6 +48,7 @@ export const CommonModal: React.FC<CommonModalProps> = ({
}, [title, titleIsI18nKey])
return (
<ShowIf condition={show}>
<Modal
{...cypressId(props)}
show={show}
@ -66,5 +67,6 @@ export const CommonModal: React.FC<CommonModalProps> = ({
</Modal.Header>
{children}
</Modal>
</ShowIf>
)
}