shigni-modale-p14-master
v1.3.4
Published
modal package for openclassrooms p14
Downloads
3
Readme
Modale P14
Installation
npm i shigni-modale-p14-master
Parameters
You'll need to import useState
from React and set the state first so the modal don't show and is able to reset
import React, { useState } from "react";
import Modal from 'shigni-modale-p14-master';
const [displayModal, setDisplayModal] = useState(false);
const [modalReset, setModalReset] = useState(false);
you can add a const
to set css properties to the modal, all listed here
const modalParameter = {
"backgroundColor": "#EEEEEE",
"borderRadius": 10,
"boxShadow": "0 0 5px #1B1919",
"color": "#1B1919",
"fontSize": 18,
"height": "fit-content",
"padding": "20px 50px",
"width": "fit-content"
}
than add the component to your project, add your function and parameters, you also can change the message,
<Modal
key={modalReset}
id="modal-created"
showModal={displayModal}
closeModal={() => setDisplayModal(false)}
parameter={modalParameter}
message="Example"
/>