-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(web): announce notifications to screen readers (#12071)
- Loading branch information
1 parent
98b3441
commit 72ab664
Showing
7 changed files
with
46 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 12 additions & 10 deletions
22
web/src/lib/components/shared-components/notification/notification-list.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
<script lang="ts"> | ||
import { notificationController } from './notification'; | ||
import { fade } from 'svelte/transition'; | ||
import { t } from 'svelte-i18n'; | ||
import NotificationCard from './notification-card.svelte'; | ||
import { flip } from 'svelte/animate'; | ||
import { quintOut } from 'svelte/easing'; | ||
const { notificationList } = notificationController; | ||
</script> | ||
|
||
{#if $notificationList.length > 0} | ||
<section transition:fade={{ duration: 250 }} id="notification-list" class="fixed right-5 top-[80px] z-[99999999]"> | ||
{#each $notificationList as notification (notification.id)} | ||
<div animate:flip={{ duration: 250, easing: quintOut }}> | ||
<NotificationCard {notification} /> | ||
</div> | ||
{/each} | ||
</section> | ||
{/if} | ||
<div role="status" aria-relevant="additions" aria-label={$t('notifications')}> | ||
{#if $notificationList.length > 0} | ||
<section transition:fade={{ duration: 250 }} id="notification-list" class="fixed right-5 top-[80px] z-[99999999]"> | ||
{#each $notificationList as notification (notification.id)} | ||
<div animate:flip={{ duration: 250, easing: quintOut }}> | ||
<NotificationCard {notification} /> | ||
</div> | ||
{/each} | ||
</section> | ||
{/if} | ||
</div> |