This plugin is for the project 14 from OpenClassrooms formation "Front-End".
npm i react-modal-p14-sebastien-d
- Import the plugin in your project like this :
import Modal from "react-modal-p14-sebastien-d";
- The state :
const [displayModal, setDisplayModal] = useState(false);
- In the return :
<Modal key={modalReset} id="modal-created" showModal={displayModal} closeModal={() => setDisplayModal(false)} parameter={modalParameter} message="Employee Created !" />
- Put this into your component :
const modalParameter = {
"backgroundColor": "#EEEEEE",
"borderRadius": 10,
"boxShadow": "0 0 5px #1B1919",
"color": "#1B1919",
"fontSize": 18,
"height": "fit-content",
"padding": "20px 50px",
"width": "fit-content"
}