add navigation for chat page

This commit is contained in:
marlon-erler
2024-07-20 14:16:26 +02:00
parent 6b269719a1
commit c4aa95d427
13 changed files with 260 additions and 57 deletions
+12 -9
View File
@@ -2,19 +2,22 @@ import "./chatEntry.css";
import * as React from "bloatless-react";
import { ChatModel } from "../../Model/chatModel";
import ChatViewModel from "../../ViewModel/chatViewModel";
export function ChatEntry(chatModel: ChatModel) {
export function ChatEntry(chatViewModel: ChatViewModel) {
return (
<button class="chat-entry tile">
<span class="shadow">{chatModel.info.primaryChannel}</span>
<h2>{chatModel.info.primaryChannel}</h2>
<button class="chat-entry tile" on:click={chatViewModel.open}>
<span
class="shadow"
subscribe:innerText={chatViewModel.primaryChannel}
></span>
<h2 subscribe:innerText={chatViewModel.primaryChannel}></h2>
</button>
);
}
export const ChatModelToChatEntry: React.StateItemConverter<ChatModel> = (
chatModel: ChatModel
) => {
return ChatEntry(chatModel);
export const ChatViewModelToChatEntry: React.StateItemConverter<
ChatViewModel
> = (chatViewModel: ChatViewModel) => {
return ChatEntry(chatViewModel);
};