1.0.6 • Published 1 year ago

hayden-react-rhnet-library v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

hayden-react-rhnet-library

Library made for the HRnet application. In this library you will find the modal.

NPM JavaScript Style Guide

Install

npm install --save hayden-react-rhnet-library

Usage

Example of the code for the Modal Classique

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={false} />
}

Example of the code for the Modal Notification

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}/>
}

Modal component props

text

Request a string. Injects the text you want into the component.

isOpen

Request a boolean. True: opens the modal. False: closes the modal.

setIsOpen= function pour mettre a jour isOpen

Sends the state function to update the "isOpen" variable.

autoClose

Request a boolean. This option closes the modal after 5 seconds. True: activates the timer. False: disables the timer.

isNotification

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.

typeNotification: {"validate"} || {"alert"} || {"error"}

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.

License

MIT © HaydenLeDev

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago