hrnet-modal-kechit 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -0
- package/package.json +15 -0
- package/src/Modal.jsx +18 -0
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Modal } from "./src/Modal";
|
package/package.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "hrnet-modal-kechit",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
7
|
+
},
|
|
8
|
+
"keywords": [],
|
|
9
|
+
"author": "",
|
|
10
|
+
"license": "ISC",
|
|
11
|
+
"description": "",
|
|
12
|
+
"peerDependencies": {
|
|
13
|
+
"react": "^18.0.0"
|
|
14
|
+
}
|
|
15
|
+
}
|
package/src/Modal.jsx
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "../assets/style/modal.css";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
function Modal({ isOpen, onClose, children }) {
|
|
6
|
+
// Ne rien afficher si la modale est fermée
|
|
7
|
+
if (!isOpen) return null;
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<div className="overlay">
|
|
11
|
+
<div className="modal">
|
|
12
|
+
<button className="closeBtn" onClick={onClose}>x</button>
|
|
13
|
+
{children}
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
export default Modal;
|