Merge pull request #16769 from overleaf/jel-scroll-to-notification

[web] Add scroll to notification component

GitOrigin-RevId: 096f9f42344729464e7fb38e4f6542cb2e891918
This commit is contained in:
Jessica Lawshe
2024-01-30 09:04:19 +00:00
committed by Copybot
parent 71ca6f05b7
commit f79f534d9f
4 changed files with 54 additions and 10 deletions
@@ -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} />