From f4e1e2206d2d148ea51370ef33c2de336719004e Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Fri, 12 Jan 2024 20:43:40 -0800
Subject: feat(settings): disable notifications option

---
 src/lib/Notification/Notification.svelte | 61 +++++++++++++++++---------------
 1 file changed, 32 insertions(+), 29 deletions(-)

(limited to 'src/lib/Notification/Notification.svelte')

diff --git a/src/lib/Notification/Notification.svelte b/src/lib/Notification/Notification.svelte
index f5e172a7..87f51c76 100644
--- a/src/lib/Notification/Notification.svelte
+++ b/src/lib/Notification/Notification.svelte
@@ -1,4 +1,5 @@
 <script lang="ts">
+	import settings from '$stores/settings';
 	import { onMount } from 'svelte';
 
 	export let notification: { [key: string]: any } = {};
@@ -16,36 +17,38 @@
 	};
 </script>
 
-<div
-	id="notification-container"
-	class={removed ? 'fade-out' : 'fade-in'}
-	on:click={remove}
-	on:keydown={() => {
-		return;
-	}}
-	role="button"
-	tabindex="0"
->
-	{#if notification.description}
-		<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
-		<details
-			open
-			id="notification"
-			on:click|preventDefault={(event) => event.preventDefault()}
-			on:keydown={() => {
-				return;
-			}}
-		>
-			<summary>{@html notification.heading}</summary>
+{#if !$settings.displayDisableNotifications}
+	<div
+		id="notification-container"
+		class={removed ? 'fade-out' : 'fade-in'}
+		on:click={remove}
+		on:keydown={() => {
+			return;
+		}}
+		role="button"
+		tabindex="0"
+	>
+		{#if notification.description}
+			<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
+			<details
+				open
+				id="notification"
+				on:click|preventDefault={(event) => event.preventDefault()}
+				on:keydown={() => {
+					return;
+				}}
+			>
+				<summary>{@html notification.heading}</summary>
 
-			{@html notification.description}
-		</details>
-	{:else}
-		<div class="card" id="notification">
-			{@html notification.heading}
-		</div>
-	{/if}
-</div>
+				{@html notification.description}
+			</details>
+		{:else}
+			<div class="card" id="notification">
+				{@html notification.heading}
+			</div>
+		{/if}
+	</div>
+{/if}
 
 <style>
 	#notification-container {
-- 
cgit v1.2.3

