mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 15:14:56 -04:00

* Add application state hook Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Add docs Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
22 lines
746 B
TypeScript
22 lines
746 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
import React from 'react'
|
|
import { UiNotificationToast } from './ui-notification-toast'
|
|
import './notifications.scss'
|
|
import { useApplicationState } from '../../hooks/common/use-application-state'
|
|
|
|
export const UiNotifications: React.FC = () => {
|
|
const notifications = useApplicationState((state) => state.uiNotifications)
|
|
|
|
return (
|
|
<div className={'notifications-area'} aria-live='polite' aria-atomic='true'>
|
|
{notifications.map((notification, notificationIndex) => (
|
|
<UiNotificationToast key={notificationIndex} notificationId={notificationIndex} {...notification} />
|
|
))}
|
|
</div>
|
|
)
|
|
}
|