feat: chat list (joined)

This commit is contained in:
Shibo Lyu 2024-09-04 05:28:10 +08:00
parent 48c5ed4687
commit 9e899bbb27
10 changed files with 162 additions and 126 deletions

View file

@ -28,7 +28,7 @@
<div class="flex h-full w-full flex-col items-center justify-center">
{#if server}
{@const { info, messages, sendMessage } = useChat(server, roomId)}
<ChatPage {info} {messages} on:sendMessage={sendMessage} />
<ChatPage {info} {messages} on:sendMessage={(e) => sendMessage(e.detail)} />
{:else}
<ServiceMessage>
To view this chat, you need to connect to chat server

View file

@ -28,7 +28,7 @@
</script>
<form
class="flex items-end gap-2 border-t border-ss-secondary bg-sb-primary p-2 shadow-sm"
class="flex w-full items-end gap-2 border-t border-ss-secondary bg-sb-primary p-2 shadow-sm"
bind:this={form}
on:submit|preventDefault={submit}
>

View file

@ -13,13 +13,13 @@
export let info: Readable<Chat>;
export let messages: Readable<Message[]>;
type $$Events = {
sendMessage: BlahRichText;
};
interface $$Events {
sendMessage: CustomEvent<BlahRichText>;
}
</script>
<ChatHeader info={$info} outsideUnreadCount={263723} />
<BgPattern class="flex-1" pattern="charlieBrown">
<BgPattern class="w-full flex-1" pattern="charlieBrown">
<ChatHistory messages={$messages} mySenderId={$currentKeyPair?.id} />
</BgPattern>
<ChatInput on:sendMessage />