I use react-responsive-modal to open some modals within my react app. When i open the modal, there is an overlay effect that darkens the background behind the modal. Is there any way to darken the background for 100% or set any color for the background so i cant see the stuff which was there before the modal was opened until i close the modal again?
I created a new component for the modal ModalComponent
within my MainComponent
, which gets rendered when i click a button:
ModalComponent
:
render() {
return (
<div className="childDiv">
<Modal
open={open}
onClose={this.onCloseModal}
center
classNames={{
transitionEnter: styles.transitionEnter,
transitionEnterActive: styles.transitionEnterActive,
transitionExit: styles.transitionExitActive,
transitionExitActive: styles.transitionExitActive
}}
animationDuration={1000}
>
...
MainComponent:
<div>
<div className="outter" onClick={this.openModal.bind(this)}>
//Open Modal when clicking on this div
<p className="arrival">Ankunft am Ziel: ~ {this.props.arrival} Uhr</p>
<p className="price">max. {this.props.price} €</p>
{this.state.open && (
<BookingModalNew
open={this.state.open}
triggerCloseModal={this.closeModal.bind(this)}
destination={this.props.destination}
arrival={this.props.arrival}
price={this.props.price}
/>
)}
//Whole Stuff should not be visible while Modal is opened