added background color, backdrop
This commit is contained in:
parent
276c97a734
commit
df1838dbba
@ -54,7 +54,20 @@ useEffect(() => {
|
|||||||
// Dynamically generate data-bs attributes
|
// Dynamically generate data-bs attributes
|
||||||
const dataAttributesProps = Object.keys(dataAttributes).map(key => ({
|
const dataAttributesProps = Object.keys(dataAttributes).map(key => ({
|
||||||
[key]: dataAttributes[key],
|
[key]: dataAttributes[key],
|
||||||
}));
|
} ) );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// The gray background
|
||||||
|
const backdropStyle = {
|
||||||
|
position: 'fixed',
|
||||||
|
top: 0,
|
||||||
|
bottom: 0,
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
backgroundColor: 'rgba(0,0,0,0.3)',
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@ -65,8 +78,9 @@ useEffect(() => {
|
|||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
ref={modalRef} // Assign the ref to the modal element
|
ref={modalRef} // Assign the ref to the modal element
|
||||||
{...dataAttributesProps}
|
{...dataAttributesProps}
|
||||||
|
style={backdropStyle}
|
||||||
>
|
>
|
||||||
<div className={`modal-dialog ${dialogClass} ${modalSizeClass } mx-sm-auto mx-1`} role={role}>
|
<div className={`modal-dialog ${dialogClass} ${modalSizeClass } mx-sm-auto mx-1`} role={role} >
|
||||||
<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 */}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user