mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-06-06 09:31:35 -04:00
Rename date prop in UI-Notification
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
5163cccca4
commit
0419113d36
4 changed files with 22 additions and 11 deletions
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import React from 'react'
|
||||
import React, { useMemo } from 'react'
|
||||
import { UiNotificationToast } from './ui-notification-toast'
|
||||
import styles from './notifications.module.scss'
|
||||
import { useApplicationState } from '../../hooks/common/use-application-state'
|
||||
|
@ -12,11 +12,15 @@ import { useApplicationState } from '../../hooks/common/use-application-state'
|
|||
export const UiNotifications: React.FC = () => {
|
||||
const notifications = useApplicationState((state) => state.uiNotifications)
|
||||
|
||||
const notificationElements = useMemo(() => {
|
||||
return notifications.map((notification, notificationIndex) => (
|
||||
<UiNotificationToast key={notificationIndex} notificationId={notificationIndex} {...notification} />
|
||||
))
|
||||
}, [notifications])
|
||||
|
||||
return (
|
||||
<div className={styles['notifications-area']} aria-live='polite' aria-atomic='true'>
|
||||
{notifications.map((notification, notificationIndex) => (
|
||||
<UiNotificationToast key={notificationIndex} notificationId={notificationIndex} {...notification} />
|
||||
))}
|
||||
{notificationElements}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue