diff --git a/src/lib/components/functional/Dialog.svelte b/src/lib/components/functional/Dialog.svelte index 230165b..9375801 100644 --- a/src/lib/components/functional/Dialog.svelte +++ b/src/lib/components/functional/Dialog.svelte @@ -33,8 +33,6 @@ let color = $derived(colors[type]); let Icon = $derived(Icons[type]); - - console.log(`ID: ${id}, type: ${type}`);
-
+
{#each toastList as { id, type, message, durations }} - +
+ +
{/each}
diff --git a/src/lib/components/visual/Toast.svelte b/src/lib/components/visual/Toast.svelte index 351df0d..15c9ce8 100644 --- a/src/lib/components/visual/Toast.svelte +++ b/src/lib/components/visual/Toast.svelte @@ -23,19 +23,22 @@ let { id, type, message, durations }: Props = $props(); - const color = { + const colors = { success: "purple", error: "red", info: "blue", warning: "pink", - }[type]; + }; - const Icon = { + const Icons = { success: CheckIcon, error: BanIcon, info: InfoIcon, warning: TriangleAlert, - }[type]; + }; + + let color = $derived(colors[type]); + let Icon = $derived(Icons[type]); // intentionally unused. this is so tailwind can generate the css for these colours as it doesn't detect if it's dynamically loaded // this would lead to the colours not being generated in the final css file by tailwind @@ -48,7 +51,7 @@
{message}