mirror of
https://github.com/FranP-code/Open-Telegram-to-Notion-Website.git
synced 2025-10-13 00:42:53 +00:00
36 lines
842 B
JavaScript
36 lines
842 B
JavaScript
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 |