Modal dialog package created for the 14th project of the OpenClassrooms' frontend development program
npm install --save jsc-modal-oc
import React, { useState } from 'react'
import ModalDialog from 'jsc-modal-oc'
import 'jsc-modal-oc/dist/index.css'
const App = () => {
const [openModal, setOpenModal] = useState(false)
const onOpenModal = () => setOpenModal(true)
const onCloseModal = () => setOpenModal(false)
const handleClickOpen = () => {
onOpenModal()
}
return (
<>
<button type='button' onClick={handleClickOpen}>
Click to open the dialog modal
</button>
{openModal && (
<ModalDialog
title='Title of the modal'
description='Description of the modal'
closeContent='Close'
handleCloseModal={onCloseModal}
/>
)}
</>
)
}
export default App
MIT © JohanSannier