store received items

This commit is contained in:
marlon-erler
2024-07-11 00:56:06 +02:00
parent b7dbe6b13d
commit d3604d474b
9 changed files with 23 additions and 14 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ import {
import { Chat } from "../Model/chatModel";
import { translation } from "../translations";
const chatConverter: React.ListItemConverter<Chat> = (chat) => {
const chatConverter: React.StateItemConverter<Chat> = (chat) => {
function select() {
selectChat(chat);
}
+1 -1
View File
@@ -20,7 +20,7 @@ export function ChatOptionModal(chat: Chat, isPresented: React.State<boolean>) {
shouldShowKey.value == true ? "text" : "password"
);
const secondaryChannelConverter: React.ListItemConverter<string> = (
const secondaryChannelConverter: React.StateItemConverter<string> = (
secondaryChannel
) => {
function remove() {
+7 -2
View File
@@ -1,6 +1,7 @@
import * as React from "bloatless-react";
import { Chat } from "../Model/chatModel";
import { Chat, Item } from "../Model/chatModel";
import { translation } from "../translations";
export function ChatToolView(chat: Chat) {
@@ -11,11 +12,15 @@ export function ChatToolView(chat: Chat) {
});
}
const itemConverter: React.StateItemConverter<Item> = (item) => {
return <span>{item.title}</span>;
};
return (
<div class="chat-tool-view">
<button on:click={createItem}>+</button>
<hr></hr>
<div children:append={[chat.items, itemConverter]}></div>
</div>
);
}
+1 -1
View File
@@ -17,7 +17,7 @@ import {
import { translation } from "../translations";
const addressConverter: React.ListItemConverter<string> = (address) => {
const addressConverter: React.StateItemConverter<string> = (address) => {
return <option>{address}</option>;
};
+2 -2
View File
@@ -5,7 +5,7 @@ import { Chat, ChatMessage } from "../Model/chatModel";
import { translation } from "../translations";
export function ThreadView(chat: Chat) {
const messageConverter: React.ListItemConverter<ChatMessage> = (message) => {
const messageConverter: React.StateItemConverter<ChatMessage> = (message) => {
function resendMessage() {
chat.resendMessage(message);
}
@@ -72,7 +72,7 @@ export function ThreadView(chat: Chat) {
);
};
const outboxMessageConverter: React.ListItemConverter<ChatMessage> = (
const outboxMessageConverter: React.StateItemConverter<ChatMessage> = (
message
) => {
function remove() {