npm-test4-ta
Advanced tools
Comparing version
import React from 'react'; | ||
import './EmployeeModal.css'; | ||
interface EmployeeModalProps { | ||
isVisible: boolean; | ||
onClose: () => void; | ||
} | ||
declare const EmployeeModal: React.FC<EmployeeModalProps>; | ||
declare const EmployeeModal: React.FC; | ||
export default EmployeeModal; |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const react_1 = __importDefault(require("react")); | ||
require("./EmployeeModal.css"); | ||
const EmployeeModal = ({ isVisible, onClose }) => { | ||
if (!isVisible) { | ||
return null; | ||
} | ||
return (react_1.default.createElement("div", { className: "modal-background" }, | ||
react_1.default.createElement("div", { className: "modal-content" }, | ||
react_1.default.createElement("span", { className: "close-button", onClick: onClose }, "\u00D7"), | ||
react_1.default.createElement("p", null, "Employee created!")))); | ||
const react_1 = __importStar(require("react")); | ||
// CSS styles | ||
const styles = { | ||
modalBackground: { | ||
position: 'fixed', | ||
top: 0, | ||
left: 0, | ||
width: '100%', | ||
height: '100%', | ||
backgroundColor: 'rgba(0, 0, 0, 0.3)', | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
}, | ||
modalContent: { | ||
backgroundColor: 'white', | ||
borderRadius: '8px', | ||
padding: '20px', | ||
position: 'relative', | ||
textAlign: 'center', | ||
boxShadow: '0 4px 8px rgba(0, 0, 0, 0.1)', | ||
}, | ||
closeButton: { | ||
position: 'absolute', | ||
top: '10px', | ||
right: '10px', | ||
cursor: 'pointer', | ||
}, | ||
}; | ||
const EmployeeModal = () => { | ||
const [isVisible, setIsVisible] = (0, react_1.useState)(true); | ||
const handleClose = () => { | ||
setIsVisible(false); | ||
}; | ||
return (isVisible && (react_1.default.createElement("div", { style: styles.modalBackground }, | ||
react_1.default.createElement("div", { style: styles.modalContent }, | ||
react_1.default.createElement("span", { style: styles.closeButton, onClick: handleClose }, "\u00D7"), | ||
react_1.default.createElement("p", null, "Employee created!"))))); | ||
}; | ||
exports.default = EmployeeModal; |
{ | ||
"name": "npm-test4-ta", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Module to test module creation", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
3374
76.56%78
122.86%