Skip to content

Commit

Permalink
Made various changes :
Browse files Browse the repository at this point in the history
- Fixed indentation in readme's usage section
- Changed version to 1.0.7 in package.json
  • Loading branch information
vzamboulingame committed Oct 21, 2023
1 parent 4da2d40 commit d804a64
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 116 deletions.
90 changes: 45 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,51 +32,51 @@ import { useState } from "react";
import Modal from "vz-react-modal";

export default function App() {
// Define state to track whether the modal is open or not
const [isOpen, setIsOpen] = useState(false);

// Add function to handle the close event of the modal
const handleClose = () => {
setIsOpen(false);
};

// Add function to handle the open event of the modal
const handleClick = () => {
setIsOpen(true);
};

return (
<div
style={{
margin: "0 auto",
textAlign: "center",
minHeight: "100vh",
padding: "1rem",
}}>
<p style={{ fontSize: "2rem", color: "#333", margin: "auto" }}>vz-react-modal</p>
<button
style={{
backgroundColor: "#0074E4",
padding: "0.5rem 1rem",
fontWeight: "bold",
color: "#fff",
cursor: "pointer",
borderRadius: "0.25rem",
marginTop: "1rem",
}}
onClick={handleClick}>
Open Modal
</button>
{/* Pass the props to the Modal component */}
<Modal
modalTitle="Modal title"
modalMessage="Modal message"
modalType="basic"
isOpen={isOpen}
handleClose={handleClose}
/>
</div>
);
// Define state to track whether the modal is open or not
const [isOpen, setIsOpen] = useState(false);

// Add function to handle the close event of the modal
const handleClose = () => {
setIsOpen(false);
};

// Add function to handle the open event of the modal
const handleClick = () => {
setIsOpen(true);
};

return (
<div
style={{
margin: "0 auto",
textAlign: "center",
minHeight: "100vh",
padding: "1rem",
}}>
<p style={{ fontSize: "2rem", color: "#333", margin: "auto" }}>vz-react-modal</p>
<button
style={{
backgroundColor: "#0074E4",
padding: "0.5rem 1rem",
fontWeight: "bold",
color: "#fff",
cursor: "pointer",
borderRadius: "0.25rem",
marginTop: "1rem",
}}
onClick={handleClick}>
Open Modal
</button>
{/* Pass the props to the Modal component */}
<Modal
modalTitle="Modal title"
modalMessage="Modal message"
modalType="basic"
isOpen={isOpen}
handleClose={handleClose}
/>
</div>
);
}
```

Expand Down
142 changes: 71 additions & 71 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,73 +1,73 @@
{
"name": "vz-react-modal",
"private": false,
"version": "1.0.6",
"author": "Vinodh Zamboulingame",
"description": "A lightweight React modal component based on the HTML dialog element",
"type": "module",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/vzamboulingame/vz-react-modal.git"
},
"keywords": [
"react",
"modal",
"dialog",
"component",
"ui",
"typescript",
"tailwind",
"tailwindcss",
"vite",
"openclassrooms"
],
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"files": [
"dist"
],
"main": "./dist/vz-react-modal.umd.cjs",
"module": "./dist/vz-react-modal.es.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/vz-react-modal.es.js",
"require": "./dist/vz-react-modal.umd.cjs"
}
},
"sideEffects": [
"**/*.css"
],
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/node": "^20.8.2",
"@types/react": "^18.2.24",
"@types/react-dom": "^18.2.7",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"@vitejs/plugin-react-swc": "^3.3.2",
"autoprefixer": "^10.4.16",
"eslint": "^8.45.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
"postcss": "^8.4.31",
"tailwindcss": "^3.3.3",
"typescript": "^5.0.2",
"vite": "^4.4.5",
"vite-plugin-dts": "^3.6.0",
"vite-plugin-lib-inject-css": "^1.3.0"
},
"peerDependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
}
"name": "vz-react-modal",
"private": false,
"version": "1.0.7",
"author": "Vinodh Zamboulingame",
"description": "A lightweight React modal component based on the HTML dialog element",
"type": "module",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/vzamboulingame/vz-react-modal.git"
},
"keywords": [
"react",
"modal",
"dialog",
"component",
"ui",
"typescript",
"tailwind",
"tailwindcss",
"vite",
"openclassrooms"
],
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"files": [
"dist"
],
"main": "./dist/vz-react-modal.umd.cjs",
"module": "./dist/vz-react-modal.es.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/vz-react-modal.es.js",
"require": "./dist/vz-react-modal.umd.cjs"
}
},
"sideEffects": [
"**/*.css"
],
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/node": "^20.8.2",
"@types/react": "^18.2.24",
"@types/react-dom": "^18.2.7",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"@vitejs/plugin-react-swc": "^3.3.2",
"autoprefixer": "^10.4.16",
"eslint": "^8.45.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
"postcss": "^8.4.31",
"tailwindcss": "^3.3.3",
"typescript": "^5.0.2",
"vite": "^4.4.5",
"vite-plugin-dts": "^3.6.0",
"vite-plugin-lib-inject-css": "^1.3.0"
},
"peerDependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
}
}

0 comments on commit d804a64

Please sign in to comment.