diff --git a/packages/builder/src/App.svelte b/packages/builder/src/App.svelte index 7cf7fb864b..76ef32a669 100644 --- a/packages/builder/src/App.svelte +++ b/packages/builder/src/App.svelte @@ -4,7 +4,7 @@ import { Router, basepath } from "@sveltech/routify" import { routes } from "../routify/routes" import { store, initialise } from "builderStore" - import NotificationDisplay from "components/common/Notification.svelte"; + import NotificationDisplay from "components/common/Notification/NotificationDisplay.svelte"; $basepath = "/_builder" diff --git a/packages/builder/src/builderStore/store/notifications.js b/packages/builder/src/builderStore/store/notifications.js index cb789b2aef..201e13e4b9 100644 --- a/packages/builder/src/builderStore/store/notifications.js +++ b/packages/builder/src/builderStore/store/notifications.js @@ -1,9 +1,15 @@ import { writable } from 'svelte/store' +import { generate } from "shortid" -export const notificationStore = writable() +export const notificationStore = writable({ + notifications: [] +}) -export function send(message, type = 'default', timeout) { - notificationStore.set({ type, message, timeout }) +export function send(message, type = 'default') { + notificationStore.update(state => { + state.notifications = [...state.notifications, { id: generate(), type, message }] + return state + }) } export const notifier = { diff --git a/packages/builder/src/components/common/Notification.svelte b/packages/builder/src/components/common/Notification.svelte deleted file mode 100644 index 2503db0b8f..0000000000 --- a/packages/builder/src/components/common/Notification.svelte +++ /dev/null @@ -1,119 +0,0 @@ - - -