aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Notification
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-10-28 15:32:46 -0700
committerFuwn <[email protected]>2024-10-28 15:32:46 -0700
commit39b677404558ae3b7eb34e818d7ca308f62f9cb0 (patch)
tree7f19fca39ecd4237e3c0d1aef2d8e9fa3cec7845 /src/lib/Notification
parentfeat(graphql): paged badges query (diff)
downloaddue.moe-svelte-5.tar.xz
due.moe-svelte-5.zip
feat: update to svelte 5svelte-5
Diffstat (limited to 'src/lib/Notification')
-rw-r--r--src/lib/Notification/Notification.svelte24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/lib/Notification/Notification.svelte b/src/lib/Notification/Notification.svelte
index 6764f46e..f2b6ac44 100644
--- a/src/lib/Notification/Notification.svelte
+++ b/src/lib/Notification/Notification.svelte
@@ -1,12 +1,18 @@
<script lang="ts">
+ import { preventDefault } from 'svelte/legacy';
+
import settings from '$stores/settings';
import { onMount } from 'svelte';
- export let notification: { [key: string]: any } = {};
- export let onRemove: () => void = () => {
+ interface Props {
+ notification?: { [key: string]: any };
+ onRemove?: () => void;
+ removed?: boolean;
+ }
+
+ let { notification = {}, onRemove = () => {
return;
- };
- export let removed = false;
+ }, removed = $bindable(false) }: Props = $props();
onMount(() => setTimeout(remove, notification.duration));
@@ -21,20 +27,20 @@
<div
id="notification-container"
class={removed ? 'fade-out' : 'fade-in'}
- on:click={remove}
- on:keydown={() => {
+ onclick={remove}
+ onkeydown={() => {
return;
}}
role="button"
tabindex="0"
>
{#if notification.description}
- <!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
+ <!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
<details
open
id="notification"
- on:click|preventDefault={(event) => event.preventDefault()}
- on:keydown={() => {
+ onclick={preventDefault((event) => event.preventDefault())}
+ onkeydown={() => {
return;
}}
>