|
@@ -10,7 +10,7 @@ export type NotificationType =
|
|
|
| 'error'
|
|
| 'error'
|
|
|
| 'offer'
|
|
| 'offer'
|
|
|
|
|
|
|
|
-type NotificationProps = {
|
|
|
|
|
|
|
+export type NotificationProps = {
|
|
|
action?: React.ReactElement
|
|
action?: React.ReactElement
|
|
|
ariaLive?: 'polite' | 'off' | 'assertive'
|
|
ariaLive?: 'polite' | 'off' | 'assertive'
|
|
|
className?: string
|
|
className?: string
|
|
@@ -21,6 +21,7 @@ type NotificationProps = {
|
|
|
onDismiss?: () => void
|
|
onDismiss?: () => void
|
|
|
title?: string
|
|
title?: string
|
|
|
type: NotificationType
|
|
type: NotificationType
|
|
|
|
|
+ id?: string
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function NotificationIcon({
|
|
function NotificationIcon({
|
|
@@ -57,6 +58,7 @@ function Notification({
|
|
|
onDismiss,
|
|
onDismiss,
|
|
|
title,
|
|
title,
|
|
|
type,
|
|
type,
|
|
|
|
|
+ id,
|
|
|
}: NotificationProps) {
|
|
}: NotificationProps) {
|
|
|
type = type || 'info'
|
|
type = type || 'info'
|
|
|
const { t } = useTranslation()
|
|
const { t } = useTranslation()
|
|
@@ -83,6 +85,7 @@ function Notification({
|
|
|
className={notificationClassName}
|
|
className={notificationClassName}
|
|
|
aria-live={ariaLive || 'off'}
|
|
aria-live={ariaLive || 'off'}
|
|
|
role="alert"
|
|
role="alert"
|
|
|
|
|
+ id={id}
|
|
|
>
|
|
>
|
|
|
<NotificationIcon notificationType={type} customIcon={customIcon} />
|
|
<NotificationIcon notificationType={type} customIcon={customIcon} />
|
|
|
|
|
|