@samakunchan/oc-modal
v1.0.4
Published
Modal pour le projet étudiant et projet final de OpenClassroom
Downloads
2
Readme
oc-modal
Simple modal for the final project OpenClassroom.
Install
npm install --save @samakunchan/oc-modal
yarn add --save @samakunchan/oc-modal
Usage
import { useState } from 'react';
import { OCModalComponent } from '@samakunchan/oc-modal';
import '@samakunchan/oc-modal/dist/index.css';
const MyComponent = () => {
const [isOpenModal, setIsOpenModal] = useState(false);
const message = 'This is my modal';
const closeModal = () => setIsOpenModal(false);
return (
<div>
<button onClick={() => setIsOpenModal(true)}>Open my modal</button>
<OCModalComponent
message={message}
isModalActive={isOpenModal}
closeModal={closeModal}
/>
</div>
);
}
export default MyComponent;
License
MIT © samakunchan