Library made for the HRnet application. In this library you will find the modal. You will find 2 types of modal, the classic modal and the "notification" modal.
npm install --save hayden-react-rhnet-library
import React from 'react'
import { useState } from "react"
import Modal from 'hayden-react-rhnet-library'
const Example = () => {
const [isOpen, setIsOpen] = useState(true)
const corpsHtml = <div><h1>Hello World</h1><p>I love dev</p></div>
return <Modal isOpen={isOpen} setIsOpen={setIsOpen} isNotification={false} corpsHtml={corpsHtml}/>
}
import React from 'react'
import { useState } from "react"
import Modal from 'hayden-react-rhnet-library'
const Example = () => {
const [isOpen, setIsOpen] = useState(true)
return <Modal isOpen={isOpen} setIsOpen={setIsOpen} text={"Hello world !"} isNotification={true} typeNotification="validate" autoClose={true}/>
}
Request a boolean. True: opens the modal. False: closes the modal.
Sends the state function to update the "isOpen" variable.
Request a boolean. This option closes the modal after 5 seconds. True: activates the timer. False: disables the timer.
Requests a variable containing html. This is displayed when you open a classic modal.
Request a string. Injects the text you want into the component. Only works for notifications. If you want to put text in a classic modal use "corpsHtml"
Request a boolean. The component is then displayed as a notification on the right side of the screen. True: The component is a notification. False: The component displays normally.
Request a string.
- "validate" allows to have a positive notification.
- "alert" makes a notification to warn the user.
- "error" signals to the user that there is an error.
MIT © HaydenLeDev