diff --git a/package.json b/package.json
index ee5e2f39..dacec74c 100644
--- a/package.json
+++ b/package.json
@@ -42,7 +42,7 @@
"@dicebear/initials": "^6.0.4",
"lemmy-js-client": "^0.18.0-rc.2",
"markdown-it": "^13.0.1",
- "mono-svelte": "^0.2.2"
+ "mono-svelte": "^0.2.8"
},
"type": "module"
}
diff --git a/src/lib/PwaReload.svelte b/src/lib/PwaReload.svelte
index 4a35ce98..ce16eb61 100644
--- a/src/lib/PwaReload.svelte
+++ b/src/lib/PwaReload.svelte
@@ -1,5 +1,5 @@
-
-
- {#if toast.loading}
-
-
-
- {:else}
-
- {/if}
-
- {#if toast.title}
-
{toast.title}
- {/if}
-
{toast.content}
-
-
- {#if toast.action}
-
- {/if}
-
-
-
diff --git a/src/lib/components/ui/toasts/ToastContainer.svelte b/src/lib/components/ui/toasts/ToastContainer.svelte
deleted file mode 100644
index 4a0017e0..00000000
--- a/src/lib/components/ui/toasts/ToastContainer.svelte
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
- {#each $toasts as toast, index (toast.id)}
-
-
-
- {/each}
-
diff --git a/src/lib/components/ui/toasts/toasts.ts b/src/lib/components/ui/toasts/toasts.ts
deleted file mode 100644
index e3c01e33..00000000
--- a/src/lib/components/ui/toasts/toasts.ts
+++ /dev/null
@@ -1,64 +0,0 @@
-import { writable } from 'svelte/store'
-
-type ToastType = keyof typeof toastColors
-
-export const toastColors = {
- error: 'bg-red-600 text-white border border-red-700',
- warning: 'bg-yellow-400 text-black border border-yellow-500',
- success: 'bg-green-400 text-black border border-green-500',
- info: 'dark:bg-zinc-900 bg-white border border-slate-200 dark:border-zinc-800 shadow-lg',
-}
-
-export interface Toast {
- id: number
- title?: string
- content: string
- type: ToastType
- loading?: boolean
- action?: () => any
-}
-
-export const toasts = writable([])
-
-export function toast({
- title,
- content,
- type = 'info',
- duration = 5000,
- loading = false,
- action,
-}: {
- title?: string
- content: string
- type?: ToastType
- duration?: number
- loading?: boolean
- action?: () => any
-}) {
- let id = 0
-
- toasts.update((toasts) => {
- id = Math.floor(Math.random() * 10000)
-
- return [
- ...toasts,
- {
- id: id,
- content: content,
- title: title,
- type: type,
- loading: loading,
- action: action,
- },
- ]
- })
-
- setTimeout(() => {
- toasts.update((toasts) => toasts.filter((toast) => toast.id != id))
- }, duration)
-
- return id
-}
-
-export const removeToast = (id: number) =>
- toasts.update((toasts) => toasts.filter((toast) => toast.id != id))
diff --git a/src/lib/util.ts b/src/lib/util.ts
index 7ebed6ca..e663528f 100644
--- a/src/lib/util.ts
+++ b/src/lib/util.ts
@@ -1,5 +1,5 @@
import { goto } from '$app/navigation'
-import { toast } from '$lib/components/ui/toasts/toasts.js'
+import { toast } from 'mono-svelte'
import { userSettings } from '$lib/settings.js'
import { get } from 'svelte/store'
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index 291db05b..18da9799 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -4,15 +4,13 @@
import { navigating } from '$app/stores'
import nProgress from 'nprogress'
import 'nprogress/nprogress.css'
- import ToastContainer from '$lib/components/ui/toasts/ToastContainer.svelte'
import Moderation from '$lib/components/lemmy/moderation/Moderation.svelte'
import Sidebar from '$lib/components/ui/sidebar/Sidebar.svelte'
- import { onMount } from 'svelte'
// @ts-ignore
import { pwaInfo } from 'virtual:pwa-info'
- import PwaReload from '$lib/PwaReload.svelte'
import { inDarkTheme } from '$lib/ui/colors.js'
import { userSettings } from '$lib/settings.js'
+ import { ToastContainer } from 'mono-svelte'
nProgress.configure({
minimum: 0.4,
diff --git a/src/routes/accounts/+page.svelte b/src/routes/accounts/+page.svelte
index 9465037c..c153b32a 100644
--- a/src/routes/accounts/+page.svelte
+++ b/src/routes/accounts/+page.svelte
@@ -11,7 +11,7 @@
import EditableList from '$lib/components/ui/list/EditableList.svelte'
import Menu from '$lib/components/ui/menu/Menu.svelte'
import MenuButton from '$lib/components/ui/menu/MenuButton.svelte'
- import { toast } from '$lib/components/ui/toasts/toasts.js'
+ import { toast } from 'mono-svelte'
import DebugObject from '$lib/components/util/debug/DebugObject.svelte'
import {
DEFAULT_INSTANCE_URL,
@@ -173,7 +173,12 @@