Skip to content

JohanSannier/jsc-modal-oc

Repository files navigation

jsc-modal-oc

Modal dialog package created for the 14th project of the OpenClassrooms' frontend development program

NPM JavaScript Style Guide

Install

npm install --save jsc-modal-oc

Usage

import React, { useState } from 'react'

import ModalDialog from 'jsc-modal-oc'

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

License

MIT © JohanSannier

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published