From 3b5cabee1124979df908ef507c670c1a900b6820 Mon Sep 17 00:00:00 2001 From: Brian Ginsburg <7957636+bgins@users.noreply.github.com> Date: Fri, 14 Oct 2022 19:26:30 -0700 Subject: [PATCH] Add info and warning notification icons (#76) * Add info and warning notification icons * Switch over to icon map --- src/components/icons/InfoThinIcon.svelte | 19 +++++++++ src/components/icons/WarningThinIcon.svelte | 19 +++++++++ .../notifications/Notification.svelte | 40 +++++++++++++++---- tailwind.config.cjs | 4 +- 4 files changed, 73 insertions(+), 9 deletions(-) create mode 100644 src/components/icons/InfoThinIcon.svelte create mode 100644 src/components/icons/WarningThinIcon.svelte diff --git a/src/components/icons/InfoThinIcon.svelte b/src/components/icons/InfoThinIcon.svelte new file mode 100644 index 0000000..05aa050 --- /dev/null +++ b/src/components/icons/InfoThinIcon.svelte @@ -0,0 +1,19 @@ + + + diff --git a/src/components/icons/WarningThinIcon.svelte b/src/components/icons/WarningThinIcon.svelte new file mode 100644 index 0000000..ce322ca --- /dev/null +++ b/src/components/icons/WarningThinIcon.svelte @@ -0,0 +1,19 @@ + + + diff --git a/src/components/notifications/Notification.svelte b/src/components/notifications/Notification.svelte index 0e6c363..92a8d6f 100644 --- a/src/components/notifications/Notification.svelte +++ b/src/components/notifications/Notification.svelte @@ -4,9 +4,38 @@ import { themeStore } from '../../stores' import type { Notification } from '$lib/notifications' import CheckThinIcon from '$components/icons/CheckThinIcon.svelte' + import InfoThinIcon from '$components/icons/InfoThinIcon.svelte' + import WarningThinIcon from '$components/icons/WarningThinIcon.svelte' import XThinIcon from '$components/icons/XThinIcon.svelte' export let notification: Notification + + const iconMap = { + info: { + component: InfoThinIcon, + props: { + color: '#1e3a8a' + } + }, + error: { + component: XThinIcon, + props: { + color: $themeStore === 'light' ? '#ffd6d7' : '#fec3c3' + } + }, + success: { + component: CheckThinIcon, + props: { + color: $themeStore === 'light' ? '#b8ffd3' : '#002e12' + } + }, + warning: { + component: WarningThinIcon, + props: { + color: '#7c2d12' + } + } + }