Skip to content

armgit / VERT

Public Imported from GitHub
0

The next-generation file converter. Open source, fully local* and free forever.

fix: toast fixes

JovannMCe6d862deb534
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}`);
</script>
<div
diff --git a/src/lib/components/layout/Toasts.svelte b/src/lib/components/layout/Toasts.svelte
index ddf9d57..bcf5e92 100644
--- a/src/lib/components/layout/Toasts.svelte
+++ b/src/lib/components/layout/Toasts.svelte
@@ -8,8 +8,12 @@
});
</script>
-<div class="fixed bottom-28 md:bottom-0 right-0 p-4 space-y-4 z-50">
+<div
+ class="fixed bottom-28 md:bottom-0 right-0 p-4 flex flex-col-reverse gap-4 z-50"
+>
{#each toastList as { id, type, message, durations }}
- <Toast {id} {type} {message} {durations} />
+ <div class="flex justify-end">
+ <Toast {id} {type} {message} {durations} />
+ </div>
{/each}
</div>
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 @@
</script>
<div
- class="flex items-center justify-between w-full max-w-sm p-4 gap-4 bg-accent-{color} border-accent-{color}-alt border-l-4 rounded-lg shadow-md"
+ class="flex items-center justify-between max-w-sm p-4 gap-4 bg-accent-{color} border-accent-{color}-alt border-l-4 rounded-lg shadow-md"
in:fly={{
duration: durations.enter,
easing: quintOut,
@@ -70,7 +73,7 @@
<p class="text-black font-normal">{message}</p>
</div>
<button
- class="text-gray-600 hover:text-black"
+ class="text-gray-600 hover:text-black flex-shrink-0"
onclick={() => removeToast(id)}
>
<XIcon size="16" />
diff --git a/src/routes/about/+page.svelte b/src/routes/about/+page.svelte
index 7417247..1464840 100644
--- a/src/routes/about/+page.svelte
+++ b/src/routes/about/+page.svelte
@@ -52,7 +52,6 @@
const cachedContribs = sessionStorage.getItem("ghContribs");
if (cachedContribs) {
ghContribs = JSON.parse(cachedContribs);
- log(["about"], "loaded GitHub contributors from cache");
return;
}