mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 06:33:55 +01:00
Merge pull request #16769 from overleaf/jel-scroll-to-notification
[web] Add scroll to notification component GitOrigin-RevId: 096f9f42344729464e7fb38e4f6542cb2e891918
This commit is contained in:
@@ -10,7 +10,7 @@ export type NotificationType =
|
||||
| 'error'
|
||||
| 'offer'
|
||||
|
||||
type NotificationProps = {
|
||||
export type NotificationProps = {
|
||||
action?: React.ReactElement
|
||||
ariaLive?: 'polite' | 'off' | 'assertive'
|
||||
className?: string
|
||||
@@ -21,6 +21,7 @@ type NotificationProps = {
|
||||
onDismiss?: () => void
|
||||
title?: string
|
||||
type: NotificationType
|
||||
id?: string
|
||||
}
|
||||
|
||||
function NotificationIcon({
|
||||
@@ -57,6 +58,7 @@ function Notification({
|
||||
onDismiss,
|
||||
title,
|
||||
type,
|
||||
id,
|
||||
}: NotificationProps) {
|
||||
type = type || 'info'
|
||||
const { t } = useTranslation()
|
||||
@@ -83,6 +85,7 @@ function Notification({
|
||||
className={notificationClassName}
|
||||
aria-live={ariaLive || 'off'}
|
||||
role="alert"
|
||||
id={id}
|
||||
>
|
||||
<NotificationIcon notificationType={type} customIcon={customIcon} />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user