mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 07:08:55 +02:00
refactor(react/dialogs): don't render modals unless they are actually shown
This commit is contained in:
parent
f7093c035b
commit
48eebbe2fe
@ -116,7 +116,7 @@ export default function Modal({ children, className, size, title, header, footer
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`modal fade mx-auto ${className}`} tabIndex={-1} style={dialogStyle} role="dialog" ref={modalRef}>
|
<div className={`modal fade mx-auto ${className}`} tabIndex={-1} style={dialogStyle} role="dialog" ref={modalRef}>
|
||||||
<div className={`modal-dialog modal-${size} ${scrollable ? "modal-dialog-scrollable" : ""}`} style={documentStyle} role="document">
|
{show && <div className={`modal-dialog modal-${size} ${scrollable ? "modal-dialog-scrollable" : ""}`} style={documentStyle} role="document">
|
||||||
<div className="modal-content">
|
<div className="modal-content">
|
||||||
<div className="modal-header">
|
<div className="modal-header">
|
||||||
{!title || typeof title === "string" ? (
|
{!title || typeof title === "string" ? (
|
||||||
@ -144,7 +144,7 @@ export default function Modal({ children, className, size, title, header, footer
|
|||||||
</ModalInner>
|
</ModalInner>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user