set up props variable close button display or not
This commit is contained in:
parent
7514e73d0c
commit
0fc460b38f
@ -8,7 +8,8 @@ const GlobalModel = ({
|
|||||||
dialogClass = '', // For additional custom classes on modal dialog
|
dialogClass = '', // For additional custom classes on modal dialog
|
||||||
role = 'dialog', // Accessibility role for the modal
|
role = 'dialog', // Accessibility role for the modal
|
||||||
size = '', // Dynamically set the size (sm, lg, xl)
|
size = '', // Dynamically set the size (sm, lg, xl)
|
||||||
dataAttributes = {} // Additional dynamic data-bs-* attributes
|
dataAttributes = {}, // Additional dynamic data-bs-* attributes
|
||||||
|
IsCloseBtn=true
|
||||||
}) => {
|
}) => {
|
||||||
const modalRef = useRef(null); // Reference to the modal element
|
const modalRef = useRef(null); // Reference to the modal element
|
||||||
|
|
||||||
@ -69,13 +70,13 @@ useEffect(() => {
|
|||||||
<div className="modal-content">
|
<div className="modal-content">
|
||||||
<div className="modal-header p-0">
|
<div className="modal-header p-0">
|
||||||
{/* Close button inside the modal header */}
|
{/* Close button inside the modal header */}
|
||||||
<button
|
{IsCloseBtn && <button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn-close"
|
className="btn-close"
|
||||||
data-bs-dismiss="modal"
|
data-bs-dismiss="modal"
|
||||||
aria-label="Close"
|
aria-label="Close"
|
||||||
onClick={closeModal} // Trigger the React closeModal function
|
onClick={closeModal} // Trigger the React closeModal function
|
||||||
></button>
|
></button>}
|
||||||
</div>
|
</div>
|
||||||
<div className="modal-body p-sm-4 p-0">
|
<div className="modal-body p-sm-4 p-0">
|
||||||
{children} {/* Render children here, which can be the ReportTask component */}
|
{children} {/* Render children here, which can be the ReportTask component */}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user