diff options
| author | Fuwn <[email protected]> | 2026-01-22 22:26:53 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-01-22 22:26:53 -0800 |
| commit | dda52424a3e7a69a01bb745033185429c8d11941 (patch) | |
| tree | 4c64d6784f668cda38c2097060145c189e3165df /src/lib/Notification/NotificationsProvider.svelte | |
| parent | format: Apply Prettier formatting (diff) | |
| download | due.moe-dda52424a3e7a69a01bb745033185429c8d11941.tar.xz due.moe-dda52424a3e7a69a01bb745033185429c8d11941.zip | |
fix(notifications): Replace svelte-notifications with custom store for Svelte 5
Diffstat (limited to 'src/lib/Notification/NotificationsProvider.svelte')
| -rw-r--r-- | src/lib/Notification/NotificationsProvider.svelte | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/lib/Notification/NotificationsProvider.svelte b/src/lib/Notification/NotificationsProvider.svelte new file mode 100644 index 00000000..964317e9 --- /dev/null +++ b/src/lib/Notification/NotificationsProvider.svelte @@ -0,0 +1,31 @@ +<script lang="ts"> + import { notifications } from './store'; + import EventNotification from './Notification.svelte'; + + export let zIndex = 5000; + + const handleRemove = (id: string) => { + notifications.remove(id); + }; +</script> + +<div class="notifications-container" style="z-index: {zIndex};"> + {#each $notifications as notification (notification.id)} + <EventNotification {notification} onRemove={() => handleRemove(notification.id)} /> + {/each} +</div> + +<slot /> + +<style> + .notifications-container { + position: fixed; + top: 0; + right: 0; + pointer-events: none; + } + + .notifications-container :global(#notification-container) { + pointer-events: auto; + } +</style> |