From 4401dce2b5545ce8117818812d8e3c8919f5f7fd Mon Sep 17 00:00:00 2001
From: Owen Jacobson <owen@grimoire.ca>
Date: Thu, 10 Oct 2024 21:05:48 -0400
Subject: Remove redundancy in `hi-ui` directory name.

---
 ui/src/lib/components/ActiveChannel.svelte | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 ui/src/lib/components/ActiveChannel.svelte

(limited to 'ui/src/lib/components/ActiveChannel.svelte')

diff --git a/ui/src/lib/components/ActiveChannel.svelte b/ui/src/lib/components/ActiveChannel.svelte
new file mode 100644
index 0000000..978e952
--- /dev/null
+++ b/ui/src/lib/components/ActiveChannel.svelte
@@ -0,0 +1,27 @@
+<script>
+    import { activeChannel, messages } from '$lib/store';
+    import Message from './Message.svelte';
+
+    let container;
+    $: messageList = $activeChannel.isSet() ? $messages.inChannel($activeChannel.get()) : [];
+
+    // TODO: eventually, store scroll height/last unread in channel? scroll there?
+
+    let scroll = (message) => {
+        message.scrollIntoView();
+    }
+</script>
+
+<div class="container" bind:this={container}>
+    {#each messageList as message}
+        <div use:scroll>
+            <Message {...message} />
+        </div>
+    {/each}
+</div>
+
+<style>
+    .container {
+        overflow: scroll;
+    }
+</style>
-- 
cgit v1.2.3

