Skip to content

Commit

Permalink
implement toast notifications on thread creation/deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
zeucapua committed Feb 6, 2025
1 parent 8abcccb commit 03d9f61
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
15 changes: 15 additions & 0 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@tailwindcss/vite": "^4.0.0",
"bits-ui": "^0.22.0",
"svelte-boring-avatars": "^1.2.6",
"svelte-french-toast": "^1.2.0",
"ulidx": "^2.4.1"
},
"devDependencies": {
Expand Down
4 changes: 3 additions & 1 deletion src/routes/(app)/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import { goto } from "$app/navigation";
import { RoomyPdsStorageAdapter } from "$lib/autodoc-storage";
import { page } from "$app/state";
import { Toaster } from "svelte-french-toast";
let { children } = $props();
Expand Down Expand Up @@ -58,6 +59,7 @@

<!-- Container -->
<div class="flex gap-4 p-4 bg-violet-900 w-screen h-screen">
<Toaster />
<!-- Server Bar -->
<aside
class="flex flex-col justify-between w-20 h-full bg-violet-950 rounded-lg px-4 py-8 items-center"
Expand Down Expand Up @@ -256,4 +258,4 @@
</aside>

{@render children()}
</div>
</div>
3 changes: 3 additions & 0 deletions src/routes/(app)/dm/[did]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import ThreadRow from "$lib/components/ThreadRow.svelte";
import { goto } from "$app/navigation";
import ChatMessage from "$lib/components/ChatMessage.svelte";
import toast from "svelte-french-toast";
let tab = $state("chat");
let channel: Autodoc<Channel> | undefined = $derived(g.dms[page.params.did]);
Expand Down Expand Up @@ -81,6 +82,7 @@
threadTitleInput = "";
isThreading.value = false;
toast.success("Thread created", { position: "bottom-end" })
}
function sendMessage(e: SubmitEvent) {
Expand Down Expand Up @@ -109,6 +111,7 @@
delete doc.threads[id]
});
toast.success("Thread deleted", { position: "bottom-end" });
goto(page.url.pathname);
}
</script>
Expand Down

0 comments on commit 03d9f61

Please sign in to comment.