From 0e1142b3ccb46b555c6222ac1017e528b8a6a2af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keviin=20=C3=85berg=20Kultalahti?= Date: Fri, 22 Jan 2021 12:31:56 +0100 Subject: [PATCH] adds notification toast capability to the client --- .../client/src/components/ClientApp.svelte | 4 +- .../src/components/NotificationDisplay.svelte | 58 +++++++++++++++++++ packages/standard-components/src/Icon.svelte | 9 +-- 3 files changed, 62 insertions(+), 9 deletions(-) diff --git a/packages/client/src/components/ClientApp.svelte b/packages/client/src/components/ClientApp.svelte index b0337bd53f..ece44ab3ee 100644 --- a/packages/client/src/components/ClientApp.svelte +++ b/packages/client/src/components/ClientApp.svelte @@ -2,6 +2,7 @@ import { writable } from "svelte/store" import { setContext, onMount } from "svelte" import Component from "./Component.svelte" + import NotificationDisplay from './NotificationDisplay.svelte' import SDK from "../sdk" import { createDataStore, initialise, screenStore, notificationStore } from "../store" @@ -23,4 +24,5 @@ {#if loaded && $screenStore.activeLayout} -{/if} \ No newline at end of file +{/if} + \ No newline at end of file diff --git a/packages/client/src/components/NotificationDisplay.svelte b/packages/client/src/components/NotificationDisplay.svelte index e69de29bb2..2bae13bfc9 100644 --- a/packages/client/src/components/NotificationDisplay.svelte +++ b/packages/client/src/components/NotificationDisplay.svelte @@ -0,0 +1,58 @@ + + +
+ {#each $notifications as notification (notification.id)} +
+
{notification.message}
+ {#if notification.icon}{/if} +
+ {/each} +
+ + + \ No newline at end of file diff --git a/packages/standard-components/src/Icon.svelte b/packages/standard-components/src/Icon.svelte index 8b5db301a6..d175bfd6b0 100644 --- a/packages/standard-components/src/Icon.svelte +++ b/packages/standard-components/src/Icon.svelte @@ -3,9 +3,6 @@ const { styleable } = getContext("sdk") const component = getContext("component") - const notification = getContext("notification") - - $: console.log($notification) export let icon = "" export let size = "fa-lg" @@ -20,8 +17,4 @@ - - \ No newline at end of file + class="{icon} {size}" /> \ No newline at end of file