summaryrefslogtreecommitdiff
path: root/ui/lib/components
diff options
context:
space:
mode:
authorKit La Touche <kit@transneptune.net>2025-08-03 23:02:37 -0400
committerKit La Touche <kit@transneptune.net>2025-08-03 23:02:37 -0400
commite6cba7c6d273b400eb70d10b1cab8a3bcc42b251 (patch)
treee57cf1e9bcde3df4ea01476cb2a3aba9039d83af /ui/lib/components
parent12f8614f6b085050b4a3d7f7bda6aba532f862f0 (diff)
Add preliminary notifications UX in settings area
Not wired up to any server actions yet.
Diffstat (limited to 'ui/lib/components')
-rw-r--r--ui/lib/components/NotificationSettings.svelte42
-rw-r--r--ui/lib/components/Toggle.svelte11
2 files changed, 53 insertions, 0 deletions
diff --git a/ui/lib/components/NotificationSettings.svelte b/ui/lib/components/NotificationSettings.svelte
new file mode 100644
index 0000000..c690b21
--- /dev/null
+++ b/ui/lib/components/NotificationSettings.svelte
@@ -0,0 +1,42 @@
+<script>
+ import Toggle from '$lib/components/Toggle.svelte';
+ // let { invites, createInvite = async () => {} } = $props();
+
+ async function onsubmit(event) {
+ event.preventDefault();
+ await createInvite();
+ }
+</script>
+
+<h2>Notify me when:</h2>
+
+<Toggle
+ name="channel_created"
+ text="A new channel is created"
+ onclick={async () => {}}
+/>
+<Toggle
+ name="message_arrives"
+ text="A new message arrives in a channel"
+ onclick={async () => {}}
+/>
+<Toggle
+ name="message_arrives_username"
+ text="A new message containing your username arrives in a channel"
+ onclick={async () => {}}
+/>
+<Toggle
+ name="message_arrives_keyword"
+ text="A new message containing a keyword you have configured arrives in a channel"
+ onclick={async () => {}}
+/>
+<Toggle
+ name="own_message_stitched"
+ text="A message you wrote is stitched"
+ onclick={async () => {}}
+/>
+<Toggle
+ name="flagged_message_stitched"
+ text="A message you have flagged is stitched"
+ onclick={async () => {}}
+/>
diff --git a/ui/lib/components/Toggle.svelte b/ui/lib/components/Toggle.svelte
new file mode 100644
index 0000000..7e71b5a
--- /dev/null
+++ b/ui/lib/components/Toggle.svelte
@@ -0,0 +1,11 @@
+<script>
+ let { text, name, onclick = async () => {} } = $props();
+</script>
+
+<label>
+ <div class="toggle">
+ <input type="checkbox" name={name} onclick={onclick}/>
+ <span class="slider"></span>
+ </div>
+ { text }
+</label>