From 6923b55c6d32f383b9ade25979c2eb6d3ad7133f Mon Sep 17 00:00:00 2001 From: zleyyij <75810274+zleyyij@users.noreply.github.com> Date: Mon, 27 Jan 2025 07:35:56 -0700 Subject: [PATCH] refactor(frontend): replace toast api (#346) --- .../lib/components/dashboard/GroupTab.svelte | 12 +-- .../lib/components/dashboard/ServerTab.svelte | 26 ++--- .../lib/components/dashboard/UserTab.svelte | 10 +- .../lib/components/editors/AssetEditor.svelte | 43 ++++----- .../components/editors/DocumentEditor.svelte | 26 ++--- .../components/sidebar/FileNavigation.svelte | 14 +-- .../lib/components/topbar/BranchButton.svelte | 65 +++++-------- .../lib/components/topbar/PullRequest.svelte | 95 ++++++------------- frontend/src/lib/groups.ts | 55 +++++------ frontend/src/lib/render.ts | 11 +-- frontend/src/lib/toast.ts | 43 +++++---- frontend/src/routes/+page.svelte | 43 ++++----- 12 files changed, 174 insertions(+), 269 deletions(-) diff --git a/frontend/src/lib/components/dashboard/GroupTab.svelte b/frontend/src/lib/components/dashboard/GroupTab.svelte index 6577392f..9374c6dd 100644 --- a/frontend/src/lib/components/dashboard/GroupTab.svelte +++ b/frontend/src/lib/components/dashboard/GroupTab.svelte @@ -103,12 +103,12 @@ }) ).json(); groups = [...groups, newGroup]; - addToast({ - message: `The ${newGroup.name} group was created successfully`, - type: ToastType.Info, - dismissible: true, - timeout: 1500 - }); + addToast( + `The ${newGroup.name} group was created successfully`, + ToastType.Info, + true, + 1500 + ); showNewGroupInput = false; } }} diff --git a/frontend/src/lib/components/dashboard/ServerTab.svelte b/frontend/src/lib/components/dashboard/ServerTab.svelte index e694ef5c..f2b3af16 100644 --- a/frontend/src/lib/components/dashboard/ServerTab.svelte +++ b/frontend/src/lib/components/dashboard/ServerTab.svelte @@ -11,30 +11,20 @@