mirror of
https://github.com/FranP-code/Open-Telegram-to-Notion-Website.git
synced 2025-10-13 00:42:53 +00:00
Auth page done
This commit is contained in:
36
src/components/Notification/Notification.jsx
Normal file
36
src/components/Notification/Notification.jsx
Normal file
@@ -0,0 +1,36 @@
|
||||
import React from 'react'
|
||||
|
||||
import './notification-style.css'
|
||||
|
||||
const Notification = ({notification, setNotification}) => {
|
||||
React.useEffect(() => {
|
||||
if (notification === false) {
|
||||
return
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
const elem = document.querySelector("#notification-element")
|
||||
elem.classList.remove('fade-in')
|
||||
elem.classList.add('fade-out')
|
||||
}, 2000)
|
||||
|
||||
setTimeout(() => {
|
||||
setNotification(false)
|
||||
}, 2400)
|
||||
|
||||
}, [notification])
|
||||
|
||||
return (
|
||||
<>
|
||||
{
|
||||
notification ?
|
||||
<div className="notification fade-in" id="notification-element">
|
||||
<p>{notification}</p>
|
||||
</div>
|
||||
: null
|
||||
}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default Notification
|
||||
Reference in New Issue
Block a user